SignDoc SDK (C)  5.0.0
SIGNDOC_Signature Class Reference

Information about a signature field returned by SIGNDOC_Document_getSignature(). More...

#include <SignDocSDK-c.h>

Public Member Functions

void SIGNDOC_Signature_delete (struct SIGNDOC_Signature *aObj)
 SIGNDOC_Signature destructor. More...
 
char * SIGNDOC_Signature_getFieldName (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj, int aEncoding)
 Get the name of the signature field. More...
 
const char * SIGNDOC_Signature_getFieldNameUTF8 (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the name of the signature field as UTF-8-encoded C string. More...
 
int SIGNDOC_Signature_getFieldPage (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the page number of the signature field. More...
 
int SIGNDOC_Signature_getSignatureType (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the type of the signature. More...
 
int SIGNDOC_Signature_getMethod (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the signing method. More...
 
int SIGNDOC_Signature_getClearedIndex (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the index of the signature at which this signature has been removed. More...
 
int SIGNDOC_Signature_getDocMDP (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the DocMDP P value of a certification signature. More...
 
int SIGNDOC_Signature_getLockMDP (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the lock MDP value. More...
 
SIGNDOC_Boolean SIGNDOC_Signature_getSigningCertificate (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj, struct SIGNDOC_ByteArray *aOutput)
 Get the signing certificate as DER-encoded blob. More...
 
char * SIGNDOC_Signature_getSignerCommonName (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj, int aEncoding)
 Get the common name from the signing certificate. More...
 
const char * SIGNDOC_Signature_getSignerCommonNameUTF8 (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the common name from the signing certificate as UTF-8-encoded C string. More...
 
char * SIGNDOC_Signature_getSignerEmail (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj, int aEncoding)
 Get the email address from the signing certificate. More...
 
const char * SIGNDOC_Signature_getSignerEmailUTF8 (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the email address from the signing certificate as UTF-8-encoded C string. More...
 
const char * SIGNDOC_Signature_getTimeStamp (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the time stamp of the signature. More...
 
int SIGNDOC_Signature_getChangeCount (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the number of changes that have been made after this signature. More...
 
int SIGNDOC_Signature_getBiometricEncryption (struct SIGNDOC_Exception **aEx, const struct SIGNDOC_Signature *aObj)
 Get the encryption method used for biometric data of the signature field. More...
 

Detailed Description

Information about a signature field returned by SIGNDOC_Document_getSignature().

If the SIGNDOC_Document object is destroyed before the SIGNDOC_Signature objects returned by its SIGNDOC_Document_getSignature() function, some functions may fail.

Member Function Documentation

void SIGNDOC_Signature_delete ( struct SIGNDOC_Signature aObj)

SIGNDOC_Signature destructor.

Parameters
[in]aObjA pointer to the SIGNDOC_Signature object.
int SIGNDOC_Signature_getBiometricEncryption ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the encryption method used for biometric data of the signature field.

Note
SIGNDOC_VerificationResult_getBiometricEncryption() provides better reporting of errors.
Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The encryption method: SIGNDOC_SIGNATUREPARAMETERS_BIOMETRICENCRYPTION_RSA, SIGNDOC_SIGNATUREPARAMETERS_BIOMETRICENCRYPTION_FIXED, SIGNDOC_SIGNATUREPARAMETERS_BIOMETRICENCRYPTION_BINARY, SIGNDOC_SIGNATUREPARAMETERS_BIOMETRICENCRYPTION_PASSPHRASE, or (on error) SIGNDOC_SIGNATUREPARAMETERS_BIOMETRICENCRYPTION_DONT_STORE.
int SIGNDOC_Signature_getChangeCount ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the number of changes that have been made after this signature.

For PDF documents, you can find out what changes have been made to the document between this signature and the next one (or after the last signature if this is the last signature).

Computing the changes can be expensive.

Changes are not reported in any particular order; before presenting them to a user, you should group them.

Detecting and categorizing changes is work in progress. Moreover, it will never be bug-compatible with Adobe products.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The number of changes.
See also
SIGNDOC_Signature_getChange()
int SIGNDOC_Signature_getClearedIndex ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the index of the signature at which this signature has been removed.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
Returns
-1 if the signature has not been removed, that is, the field is still signed; a non-negative value (greater than the index of gthis signature) indicating the index of the signature at which this signature was found to have been removed. If the return value equals the number of signatures (as returned by SIGNDOC_Document_getSignatureCount()), this signature has been removed after performing the last signature.
See also
SIGNDOC_Document_clearSignature(), SIGNDOC_Document_getSignature(), SIGNDOC_Document_getSignatureCount()
int SIGNDOC_Signature_getDocMDP ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the DocMDP P value of a certification signature.

The MDP P value specifies what modifications to the document are allowed by the certification signature.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
Returns
-1 if this signature is not a certification signature, 1 if no modifications are allowed, 2 if only filling in forms, instantiating page templates, and signing are permitted, 3 if only filling in forms, instantiating page templates, signing, creating annotations, deleting annotations, and modifying annotations are permitted. For TIFF documents, this function always returns -1.
See also
SIGNDOC_Signature_getLockMDP()
char * SIGNDOC_Signature_getFieldName ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj,
int  aEncoding 
)

Get the name of the signature field.

This function throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_ENCODING_ERROR if the name cannot be represented using the specified encoding.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
[in]aEncodingThe encoding to be used for the return value (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
Returns
The name of the field. The string must be freed with SIGNDOC_free().
See also
SIGNDOC_Signature_getFieldNameUTF8()
const char * SIGNDOC_Signature_getFieldNameUTF8 ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the name of the signature field as UTF-8-encoded C string.

Note
Do not call SIGNDOC_free() on the return value.
Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The name of the field. This pointer will become invalid when aObj is destroyed.
int SIGNDOC_Signature_getFieldPage ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the page number of the signature field.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
Returns
The 1-based page number or 0 if the page number is unknown.
int SIGNDOC_Signature_getLockMDP ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the lock MDP value.

The lock MDP value specifies what modifications to the document are allowed by the signature lock dictionary.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
Returns
-1 if the signature does not have a lock MDP value, 1 if no modifications are allowed, 2 if only filling in forms, instantiating page templates, and signing are permitted, 3 if only filling in forms, instantiating page templates, signing, creating annotations, deleting annotations, and modifying annotations are permitted. For TIFF documents, this function always returns -1.
See also
SIGNDOC_Signature_getDocMDP()
int SIGNDOC_Signature_getMethod ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the signing method.

If the output is SIGNDOC_SIGNATUREPARAMETERS_METHOD_DIGSIG_CADES_RFC3161, the signature is a document time stamp.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The signing method: SIGNDOC_SIGNATUREPARAMETERS_METHOD_DIGSIG_PKCS1, SIGNDOC_SIGNATUREPARAMETERS_METHOD_DIGSIG_PKCS7_DETACHED, SIGNDOC_SIGNATUREPARAMETERS_METHOD_DIGSIG_PKCS7_SHA1, SIGNDOC_SIGNATUREPARAMETERS_METHOD_HASH, SIGNDOC_SIGNATUREPARAMETERS_METHOD_DIGSIG_CADES_DETACHED, or SIGNDOC_SIGNATUREPARAMETERS_METHOD_DIGSIG_CADES_RFC3161.
SIGNDOC_RETURNCODE_OK if successful, SIGNDOC_RETURNCODE_NOT_VERIFIED if verification has failed.
int SIGNDOC_Signature_getSignatureType ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the type of the signature.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
Returns
SIGNDOC_FIELD_SIGNATURETYPE_APPROVAL, SIGNDOC_FIELD_SIGNATURETYPE_CERTIFICATION, or SIGNDOC_FIELD_SIGNATURETYPE_DOCUMENT_TIME_STAMP.
char * SIGNDOC_Signature_getSignerCommonName ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj,
int  aEncoding 
)

Get the common name from the signing certificate.

This function throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_ENCODING_ERROR if the name cannot be represented using the specified encoding.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
[in]aEncodingThe encoding to be used for the return value (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
Returns
The common name from the signing certificate, empty on error. The string must be freed with SIGNDOC_free().
See also
SIGNDOC_Signature_getSignerCommonNameUTF8()
const char * SIGNDOC_Signature_getSignerCommonNameUTF8 ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the common name from the signing certificate as UTF-8-encoded C string.

Note
Do not call SIGNDOC_free() on the return value.
Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The common name from the signing certificate, empty on error. This pointer will become invalid when aObj is destroyed.
char * SIGNDOC_Signature_getSignerEmail ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj,
int  aEncoding 
)

Get the email address from the signing certificate.

This function throws an exception of type SIGNDOC_EXCEPTION_TYPE_SPOOC_ENCODING_ERROR if the email address cannot be represented using the specified encoding.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Field object.
[in]aEncodingThe encoding to be used for the return value (SIGNDOC_ENCODING_NATIVE, SIGNDOC_ENCODING_UTF_8, or SIGNDOC_ENCODING_LATIN_1).
Returns
The email address from the signing certificate, empty on error. The string must be freed with SIGNDOC_free().
See also
SIGNDOC_Signature_getSignerEmailUTF8()
const char * SIGNDOC_Signature_getSignerEmailUTF8 ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the email address from the signing certificate as UTF-8-encoded C string.

Note
Do not call SIGNDOC_free() on the return value.
Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The email address from the signing certificate, empty on error. This pointer will become invalid when aObj is destroyed.
SIGNDOC_Boolean SIGNDOC_Signature_getSigningCertificate ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj,
struct SIGNDOC_ByteArray aOutput 
)

Get the signing certificate as DER-encoded blob.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
[in,out]aOutputThe DER-encoded signing certificate will be stored here.
Returns
SIGNDOC_TRUE if successful.
const char * SIGNDOC_Signature_getTimeStamp ( struct SIGNDOC_Exception **  aEx,
const struct SIGNDOC_Signature aObj 
)

Get the time stamp of the signature.

You have to use SIGNDOC_Document_verifySignature2() to find out whether the time stamp can be trusted.

Parameters
[out]aExAny exception will be returned in the object pointed to by this parameter.
[in]aObjA pointer to the SIGNDOC_Signature object.
Returns
The time stamp of the signature in ISO 8601 format: "yyyy-mm-ddThh:mm:ss" with optional timezone. Empty on error. This pointer will become invalid when aObj is destroyed.

The documentation for this class was generated from the following file: