SignDoc SDK (C++)  5.0.0
SignDocSignature Class Reference

Information about a signature field returned by SignDocDocument::getSignature(). More...

#include <SignDocSDK-cpp.h>

Public Member Functions

 ~SignDocSignature ()
 Destructor. More...
 
std::string getFieldName (Encoding aEncoding) const
 Get the name of the signature field. More...
 
const char * getFieldNameUTF8 () const
 Get the name of the signature field as UTF-8-encoded C string. More...
 
int getFieldPage () const
 Get the page number of the signature field. More...
 
SignDocField::SignatureType getSignatureType () const
 Get the type of the signature. More...
 
SignDocSignatureParameters::Method getMethod () const
 Get the signing method. More...
 
int getClearedIndex () const
 Get the index of the signature at which this signature has been removed. More...
 
int getDocMDP () const
 Get the DocMDP P value of a certification signature. More...
 
int getLockMDP () const
 Get the lock MDP value. More...
 
bool getSigningCertificate (std::vector< unsigned char > &aOutput) const
 Get the signing certificate as DER-encoded blob. More...
 
std::string getSignerCommonName (Encoding aEncoding) const
 Get the common name from the signing certificate. More...
 
const char * getSignerCommonNameUTF8 () const
 Get the common name from the signing certificate as UTF-8-encoded C string. More...
 
std::string getSignerEmail (Encoding aEncoding) const
 Get the email address from the signing certificate. More...
 
const char * getSignerEmailUTF8 () const
 Get the email address from the signing certificate as UTF-8-encoded C string. More...
 
const char * getTimeStamp () const
 Get the time stamp of the signature. More...
 
int getChangeCount () const
 Get the number of changes that have been made after this signature. More...
 
bool getChange (int aIndex, std::unique_ptr< SignDocChange > &aOutput) const
 Get a SignDocChange object for a change. More...
 
int getBiometricEncryption () const
 Get the encryption method used for biometric data of the signature field. More...
 
 SignDocSignature (SIGNDOC_Signature *aP)
 Internal function. More...
 
SIGNDOC_Signature * getImpl ()
 Internal function. More...
 
const SIGNDOC_Signature * getImpl () const
 Internal function. More...
 
void setImpl (SIGNDOC_Signature *aP)
 Internal function. More...
 

Protected Member Functions

 SignDocSignature ()
 Constructor (unavailable). More...
 

Detailed Description

Information about a signature field returned by SignDocDocument::getSignature().

If the SignDocDocument object is destroyed before the SignDocSignature objects returned by its getSignature() function, some functions may fail.

Constructor & Destructor Documentation

~SignDocSignature ( )
inline

Destructor.

SignDocSignature ( )
inlineprotected

Constructor (unavailable).

Use SignDocDocument::getSignature().

SignDocSignature ( SIGNDOC_Signature *  aP)
inline

Internal function.

Member Function Documentation

int getBiometricEncryption ( ) const
inline

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

Note
SignDocVerificationResult::getBiometricEncryption() provides better reporting of errors.
Returns
The encryption method, one of the values of SignDocSignatureParameters::BiometricEncryption, SignDocSignatureParameters::be_dont_store on error.
bool getChange ( int  aIndex,
std::unique_ptr< SignDocChange > &  aOutput 
) const
inline

Get a SignDocChange object for a change.

Parameters
[in]aIndexThe zero-based index of the change.
[out]aOutputA pointer to the new SignDocChange object will be stored here. The caller is responsible for destroying the object.
Returns
true if successful, false if aIndex is out of range.
See also
getChangeCount()
int getChangeCount ( ) const
inline

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.

Returns
The number of changes.
See also
getChange()
int getClearedIndex ( ) const
inline

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

This function always returns -1 for TIFF document.

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 SignDocDocument::getSignatureCount()), this signature has been removed after performing the last signature.
See also
SignDocDocument::clearSignature(), SignDocDocument::getSignature(), SignDocDocument::getSignatureCount()
int getDocMDP ( ) const
inline

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.

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
getLockMDP()
std::string getFieldName ( Encoding  aEncoding) const
inline

Get the name of the signature field.

This function throws std::runtime_error if the name cannot be represented using the specified encoding.

Parameters
[in]aEncodingThe encoding to be used for the return value.
Returns
The name of the field.
See also
getFieldNameUTF8()
const char * getFieldNameUTF8 ( ) const
inline

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

Returns
The name of the field. This pointer will become invalid when this object is destroyed.
See also
getFieldName()
int getFieldPage ( ) const
inline

Get the page number of the signature field.

Returns
The 1-based page number or 0 if the page number is unknown.
SIGNDOC_Signature* getImpl ( )
inline

Internal function.

const SIGNDOC_Signature* getImpl ( ) const
inline

Internal function.

int getLockMDP ( ) const
inline

Get the lock MDP value.

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

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
getDocMDP(), SignDocField::getLockMDP()
SignDocSignatureParameters::Method getMethod ( ) const
inline

Get the signing method.

If the output is SignDocSignatureParameters::m_digsig_cades_rfc3161, the signature is a document time stamp.

Returns
The signing method, see SignDocSignatureParameters::Method. SignDocSignatureParameters::m_default is never returned.
SignDocField::SignatureType getSignatureType ( ) const
inline
std::string getSignerCommonName ( Encoding  aEncoding) const
inline

Get the common name from the signing certificate.

This function throws std::runtime_error if the name cannot be represented using the specified encoding.

Parameters
[in]aEncodingThe encoding to be used for the return value.
Returns
The common name from the signing certificate, empty on error.
See also
getSignerCommonNameUTF8()
const char * getSignerCommonNameUTF8 ( ) const
inline

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

Returns
The common name from the signing certificate, empty on error. This pointer will become invalid when this object is destroyed.
See also
getSignerCommonName()
std::string getSignerEmail ( Encoding  aEncoding) const
inline

Get the email address from the signing certificate.

This function throws std::runtime_error if the email address cannot be represented using the specified encoding.

Parameters
[in]aEncodingThe encoding to be used for the return value.
Returns
The email address from the signing certificate, empty on error.
See also
getSignerEmailUTF8()
const char * getSignerEmailUTF8 ( ) const
inline

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

Returns
The email address from the signing certificate, empty on error. This pointer will become invalid when this object is destroyed.
See also
getSignerEmail()
bool getSigningCertificate ( std::vector< unsigned char > &  aOutput) const
inline

Get the signing certificate as DER-encoded blob.

Parameters
[out]aOutputThe DER-encoded signing certificate will be stored here.
Returns
true iff successful.
const char * getTimeStamp ( ) const
inline

Get the time stamp of the signature.

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

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 this object is destroyed.
void setImpl ( SIGNDOC_Signature *  aP)
inline

Internal function.


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