Portuguese eID Middleware SDK
Version: 3.12.0
|
#include <eidlib.h>
Public Member Functions | |
PTEIDSDK_API | PTEID_CMDSignatureClient () |
virtual PTEIDSDK_API | ~PTEID_CMDSignatureClient () |
PTEIDSDK_API void | setMobileNumberCaching (bool enabled) |
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 | 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 |
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 () |
Static Public Member Functions | |
static PTEIDSDK_API void | setCredentials (const char *basicAuthUser, const char *basicAuthPassword, const char *applicationId) |
Additional Inherited Members | |
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) |
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 |
This class is a client for signing with Chave Móvel Digital.
PTEIDSDK_API eIDMW::PTEID_CMDSignatureClient::PTEID_CMDSignatureClient | ( | ) |
Default constructor
|
virtual |
Destructor
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
This method returns the certificates for the account used in the last signature performed by this client. If no signature was made, it will open a dialog to introduce the CMD credentials for the account of the certificates to be obtained.
Implements eIDMW::PTEID_SigningDevice.
|
inlineoverridevirtual |
Get type of SigningDeviceType.
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
Implements eIDMW::PTEID_SigningDevice.
|
static |
Set the credentials for the CMD services. The credentials must be set once before using the CMD services and will be used for every instance of PTEID_CMDSignatureClient.
PTEIDSDK_API void eIDMW::PTEID_CMDSignatureClient::setMobileNumberCaching | ( | bool | enabled | ) |
If setMobileNumberCaching is enabled, the mobile number used in a previous signature with this instance is cached and displayed in the signature dialog as a placeholder.
|
overridevirtual |
Raw RSA signature with PCKS #1 padding.
data | holds the data to be signed, at most 32 bytes. This data should be hashed using sha256. |
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 |
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 |
PTEID_Exception(EIDMW_ERR_NOT_IMPLEMENTED) | the method is not implemented. |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
PTEID_Exception(EIDMW_ERR_NOT_IMPLEMENTED) | the method is not implemented. |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
PTEID_Exception(EIDMW_ERR_NOT_IMPLEMENTED) | the method is not implemented. |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
PTEID_Exception(EIDMW_ERR_NOT_IMPLEMENTED) | the method is not implemented. |
Implements eIDMW::PTEID_SigningDevice.
|
overridevirtual |
PTEID_Exception(EIDMW_ERR_NOT_IMPLEMENTED) | the method is not implemented. |
Implements eIDMW::PTEID_SigningDevice.