Portuguese eID Middleware SDK
Version: 3.12.0
|
#include <eidlib.h>
Public Member Functions | |
virtual PTEIDSDK_API | ~PTEID_Card ()=0 |
virtual PTEIDSDK_API PTEID_CardType | getType () |
virtual PTEIDSDK_API PTEID_ByteArray | sendAPDU (const PTEID_ByteArray &cmd) |
virtual PTEIDSDK_API PTEID_ByteArray | Sign (const PTEID_ByteArray &data, bool signatureKey=false) override |
virtual PTEIDSDK_API PTEID_ByteArray | SignSHA256 (const PTEID_ByteArray &data, bool signatureKey=false) override |
virtual PTEIDSDK_API PTEID_ByteArray | Sign (const PTEID_ByteArray &data, PTEID_RSAPaddingType paddingType, bool signatureKey=false) |
virtual PTEIDSDK_API PTEID_ByteArray | SignXades (const char *output_path, const char *const *paths, unsigned int n_paths, PTEID_SignatureLevel level=PTEID_LEVEL_BASIC) override |
virtual PTEIDSDK_API PTEID_ByteArray | SignXadesT (const char *output_path, const char *const *paths, unsigned int n_paths) override |
virtual PTEIDSDK_API PTEID_ByteArray | SignXadesA (const char *output_path, const char *const *paths, unsigned int n_paths) override |
virtual PTEIDSDK_API void | SignXadesIndividual (const char *output_path, const char *const *paths, unsigned int n_paths) override |
virtual PTEIDSDK_API void | SignXadesTIndividual (const char *output_path, const char *const *paths, unsigned int n_paths) override |
virtual PTEIDSDK_API void | SignXadesAIndividual (const char *output_path, const char *const *paths, unsigned int n_paths) override |
virtual PTEIDSDK_API int | SignPDF (PTEID_PDFSignature &sig_handler, int page, int page_sector, bool is_landscape, const char *location, const char *reason, const char *outfile_path) override |
virtual PTEIDSDK_API int | SignPDF (PTEID_PDFSignature &sig_handler, int page, double coord_x, double coord_y, const char *location, const char *reason, const char *outfile_path) override |
virtual PTEIDSDK_API PTEID_Certificates & | getCertificates () override |
virtual PTEIDSDK_API PTEID_Certificate & | getCert (PTEID_CertifType type) override |
virtual PTEIDSDK_API PTEID_Certificate & | getRoot () override |
virtual PTEIDSDK_API PTEID_Certificate & | getCA () override |
virtual PTEIDSDK_API PTEID_Certificate & | getSignature () override |
virtual PTEIDSDK_API PTEID_Certificate & | getAuthentication () override |
virtual PTEIDSDK_API PTEID_SigningDeviceType | getDeviceType () override |
virtual PTEIDSDK_API PTEID_ByteArray | readFile (const char *fileID, unsigned long ulOffset=0, unsigned long ulMaxLength=0) |
virtual PTEIDSDK_API bool | writeFile (const char *fileID, const PTEID_ByteArray &oData, unsigned long ulOffset=0) |
virtual PTEIDSDK_API void | initPaceAuthentication (const char *secret, size_t length, PTEID_CardPaceSecretType secretType) |
Public Member Functions inherited from eIDMW::PTEID_Object | |
virtual PTEIDSDK_API | ~PTEID_Object ()=0 |
NOEXPORT_PTEIDSDK void | Init (const SDK_Context *context, void *impl) |
NOEXPORT_PTEIDSDK void | Release () |
Protected Member Functions | |
PTEID_Card (const SDK_Context *context, APL_Card *impl) | |
Protected Member Functions inherited from eIDMW::PTEID_Object | |
PTEID_Object (const SDK_Context *context, void *impl) | |
void | addObject (PTEID_Object *impl) |
void | backupObject (unsigned long idx) |
PTEID_Object * | getObject (unsigned long idx) |
PTEID_Object * | getObject (void *impl) |
void | delObject (unsigned long idx) |
void | delObject (void *impl) |
void | checkContextStillOk () const |
PTEID_Object (const PTEID_Object &obj) | |
PTEID_Object & | operator= (const PTEID_Object &obj) |
Additional Inherited Members | |
Protected Attributes inherited from eIDMW::PTEID_Object | |
bool | m_delimpl |
void * | m_impl |
unsigned long | m_ulIndexExtAdd |
std::map< unsigned long, PTEID_Object * > | m_objects |
SDK_Context * | m_context |
Abstract base class for all the card type supported. The PTEID_ReaderContext::getCard() method will return such an object.
|
pure virtual |
Destructor
|
protected |
For internal use : Constructor
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
inlineoverridevirtual |
Get type of SigningDeviceType.
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
virtual |
Return the type of the card
|
virtual |
Init the Pace authentication process
secret | string that holds the secret to make the PACE process |
length | size of the secret string |
secretType | type of the secret used to make the PACE process |
|
virtual |
Read a File from the card.
fileID | is the path of the file |
ulOffset | is the offset to begin the reading |
ulMaxLength | is the maximum length of bytes to read |
|
virtual |
Send an APDU command to the card and get the result.
cmd | is the apdu command |
|
overridevirtual |
Signs a block of data using RSA-PKCS#1.
data | block of data to be signed. Has to be hashed using either sha1, sha256, sha384 or sha512. Therefore, size of data array has to be at max 64 bytes. |
signatureKey | by default uses the 'Authentication private key' to sign message. Setting this to true makes use of 'Signature private key' instead. |
Implements eIDMW::PTEID_SigningDevice.
|
virtual |
Signs a block of data using either RSA-PKCS#1 or RSA-PSS.
data | block of data to be signed. Has to be hashed using either sha1, sha256, sha384 or sha512. Therefore, data has to be at max 64 bytes. |
paddingType | either RSA-PSS or RSA-PKCS#1 |
signatureKey | by default uses the 'Authentication private key' to sign message. Setting this to true makes use of 'Signature private key' instead. |
|
overridevirtual |
PDF Signature with location by page sector (the portrait A4 page is split into 18 cells: 6 lines and 3 columns) If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a PAdES-B signature. If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a PAdES-LT or PAdES-LTA depending where the timestamping fails.
sig_handler | this defines the input file and some signature options |
page | in case of visible signature it defines the page where the signature will appear |
page_sector | position in the signature grid, between 1 to 18 for Portrait documents and 1 to 20 for Landscape ones |
is_landscape | is unused parameter, the SDK now detects document orientation automatically |
location | Signature metadata field |
reason | Signature metadata field |
outfile_path | Native Filesystem path of the ouput file |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
PDF Signature with location by coordinates (expressed in percentage of page height/width). The coordinate system has its origin in the top left corner of the page If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a PAdES-B signature. If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a PAdES-LT or PAdES-LTA depending where the timestamping fails.
sig_handler | this defines the input file and some signature options |
page | in case of visible signature it defines the page where the signature will appear |
coord_x | X coordinate of the signature location (percentage of page width) |
coord_y | Y coordinate of the signature location (percentage of page height) |
location | Location field in the added signature metadata |
reason | Signature metadata field |
outfile_path | Native Filesystem path of the ouput file |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Raw RSA signature with PCKS #1 padding (applied to a SHA256 hash).
data | holds the data to be signed, it should be 32 bytes. |
signatureKey | whether to use the 'Signature key'. By default, it uses the 'Authentication private key'. To sign with the 'Signature private key' set the parameter signatureKey to true. |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Produce a XAdES Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path.
paths | is an array of null-terminated strings representing absolute paths in the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature |
n_paths | is the number of elements in the paths array |
output_path | points to the resulting container |
level | is an enum used to set the XAdES signature level/profile: XAdES-B (PTEID_LEVEL_BASIC), XAdES-T (PTEID_LEVEL_T), XAdES-LTA (PTEID_LEVEL_LTV). Note: Setting parameter level to PTEID_LEVEL_LT will throw PTEID_Exception(EIDMW_ERR_PARAM_BAD), as it is not supported yet. |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Produce a XAdES-LTA Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path. If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature. If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a XAdES-LT or XAdES-LTA depending where the timestamping fails.
paths | is an array of null-terminated strings representing absolute paths in the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature |
n_paths | is the number of elements in the paths array |
output_path | points to the resulting container |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Produce XAdES-A Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format. If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature. If PTEID_Exception(EIDMW_LTV_ERROR) is thrown, the resulting file is a XAdES-LT or XAdES-LTA depending where the timestamping fails.
paths | is an array of null-terminated strings representing absolute paths in the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature |
n_paths | is the number of elements in the paths array |
output_path | directory of the created ASiC containers |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Produce XAdES-B Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format.
paths | is an array of null-terminated strings representing absolute paths in the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature |
n_paths | is the number of elements in the paths array |
output_path | directory of the created ASiC containers |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Produce a XAdES-T Signature of the files indicated by the parameter paths and stores the results in one ASiC container in a zip format. The location of the resulting ASiC container is indicated by the parameter output_path. If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.
paths | is an array of null-terminated strings representing absolute paths in the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature |
n_paths | is the number of elements in the paths array |
output_path | points to the resulting container |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Produce XAdES-T Signatures of the files indicated by the parameter paths and stores each of the results in an individual ASiC container in a zip format. If PTEID_Exception(EIDMW_TIMESTAMP_ERROR) is thrown, the resulting file is a XAdES-B signature.
paths | is an array of null-terminated strings representing absolute paths in the local filesystem. Those files content (hashed with SHA-256 algorithm) will be the input data for the RSA signature |
n_paths | is the number of elements in the paths array |
output_path | directory of the created ASiC containers |
Implements eIDMW::PTEID_SigningDevice.
|
virtual |
Write a file to the card.
fileID | is the path of the file |
oData | contents the bytes to write |
ulOffset | is the offset to begin the writing |