Pdftools SDK
|
Go to the source code of this file.
#define PDFTOOLS_CALL |
#define PdfToolsCryptoProvidersBuiltIn_Provider_CreatePreparedSignature PdfToolsCryptoProvidersBuiltIn_Provider_CreatePreparedSignatureA |
#define PdfToolsCryptoProvidersBuiltIn_Provider_CreateSignatureFromCertificate PdfToolsCryptoProvidersBuiltIn_Provider_CreateSignatureFromCertificateA |
#define PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrl PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrlA |
#define PdfToolsCryptoProvidersBuiltIn_Provider_SetTimestampUrl PdfToolsCryptoProvidersBuiltIn_Provider_SetTimestampUrlA |
PDFTOOLS_EXPORT TPdfToolsSign_SignatureConfiguration *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_CreatePreparedSignatureA | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
int | iSize, | ||
const char * | szFormat, | ||
const char * | szName ) |
Create a configuration to prepare a signature for an external signature handler This method is part of a very specialized use case requiring an external signature handler. The process using an external signature handler is:
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | iSize | The expected size of the cryptographic signature that will be added later. This is the number of bytes that will be reserved in the prepared signature. |
[in] | szFormat | The format (SubFilter) of the cryptographic signature that is added later. For example, "adbe.pkcs7.detached" or "ETSI.CAdES.detached" . |
[in] | szName | The name of the signer of the cryptographic signature that will be added later. |
NULL
if there is an error. NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsSign_SignatureConfiguration *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_CreatePreparedSignatureW | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
int | iSize, | ||
const WCHAR * | szFormat, | ||
const WCHAR * | szName ) |
Create a configuration to prepare a signature for an external signature handler This method is part of a very specialized use case requiring an external signature handler. The process using an external signature handler is:
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | iSize | The expected size of the cryptographic signature that will be added later. This is the number of bytes that will be reserved in the prepared signature. |
[in] | szFormat | The format (SubFilter) of the cryptographic signature that is added later. For example, "adbe.pkcs7.detached" or "ETSI.CAdES.detached" . |
[in] | szName | The name of the signer of the cryptographic signature that will be added later. |
NULL
if there is an error. NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_CreateSignatureFromCertificateA | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
const TPdfToolsSys_StreamDescriptor * | pStreamDesc, | ||
const char * | szPassword ) |
Create a configuration to sign with a PFX (PKCS#12) soft certificate The file must contain the certificate itself, all certificates of the trust chain, and the private key.
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | pStreamDesc | The signing certificate in PKCS#12 format (.p12, .pfx). |
[in] | szPassword | The password required to decrypt the private key of the archive. |
NULL
if there is an error. NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_CreateSignatureFromCertificateW | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
const TPdfToolsSys_StreamDescriptor * | pStreamDesc, | ||
const WCHAR * | szPassword ) |
Create a configuration to sign with a PFX (PKCS#12) soft certificate The file must contain the certificate itself, all certificates of the trust chain, and the private key.
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | pStreamDesc | The signing certificate in PKCS#12 format (.p12, .pfx). |
[in] | szPassword | The password required to decrypt the private key of the archive. |
NULL
if there is an error. NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsCryptoProvidersBuiltIn_TimestampConfiguration *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_CreateTimestamp | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider | ) |
Create a time-stamp configuration Note that to create time-stamps, the PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrl must be set.
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
NULL
if there is an error. NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrlA | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
char * | pBuffer, | ||
size_t | nBufferSize ) |
The URL of the trusted time-stamp authority (TSA) from which time-stamps shall be acquired.
The TSA must support the time-stamp protocol as defined in RFC 3161.
The property’s value must be a URL with the following elements:
http[s]://[‹user›[:‹password›]@]‹host›[:‹port›][/‹resource›]
Where:
http/https
: Protocol for connection to TSA.‹user›:‹password›
(optional): Credentials for connection to TSA (basic authorization).‹host›
: Hostname of TSA.‹port›
: Port for connection to TSA.‹resource›
: The resource.Applying a time-stamp requires an online connection to a time server; the firewall must be configured accordingly. If a web proxy is used (see PdfTools_Sdk_GetProxy), make sure the following MIME types are supported:
application/timestamp-query
application/timestamp-reply
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[out] | pBuffer | Retrieved value. To determine the required buffer size, the function has to be called with NULL . The return value of this function specifies the buffer size. |
[in] | nBufferSize | The buffer size of the retrieved string pBuffer . |
pBuffer
. 0
if either an error occurred or the returned buffer is actually NULL
. To determine if an error has occurred, check the error code as described in the note section below. 0
was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT size_t PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrlW | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
WCHAR * | pBuffer, | ||
size_t | nBufferSize ) |
The URL of the trusted time-stamp authority (TSA) from which time-stamps shall be acquired.
The TSA must support the time-stamp protocol as defined in RFC 3161.
The property’s value must be a URL with the following elements:
http[s]://[‹user›[:‹password›]@]‹host›[:‹port›][/‹resource›]
Where:
http/https
: Protocol for connection to TSA.‹user›:‹password›
(optional): Credentials for connection to TSA (basic authorization).‹host›
: Hostname of TSA.‹port›
: Port for connection to TSA.‹resource›
: The resource.Applying a time-stamp requires an online connection to a time server; the firewall must be configured accordingly. If a web proxy is used (see PdfTools_Sdk_GetProxy), make sure the following MIME types are supported:
application/timestamp-query
application/timestamp-reply
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[out] | pBuffer | Retrieved value. To determine the required buffer size, the function has to be called with NULL . The return value of this function specifies the buffer size. |
[in] | nBufferSize | The buffer size of the retrieved string pBuffer . |
pBuffer
. 0
if either an error occurred or the returned buffer is actually NULL
. To determine if an error has occurred, check the error code as described in the note section below. 0
was returned and the error code returned by PdfTools_GetLastError is different from ePdfTools_Error_Success. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsCryptoProvidersBuiltIn_Provider *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_New | ( | void | ) |
NULL
if there is an error.
NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsSign_SignatureConfiguration *PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_ReadExternalSignature | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
const unsigned char * | pSignature, | ||
size_t | nSignatures ) |
Read signature created by an external signature handler See PdfToolsCryptoProvidersBuiltIn_Provider_CreatePreparedSignature for more information on the signing process using an external signature handler.
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | pSignature | This signature must not be larger than the number of bytes reserved in the prepared signature. |
[in] | nSignatures | Size of the array pSignature . |
NULL
if there is an error. NULL
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_SetTimestampUrlA | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
const char * | szTimestampUrl ) |
The URL of the trusted time-stamp authority (TSA) from which time-stamps shall be acquired.
The TSA must support the time-stamp protocol as defined in RFC 3161.
The property’s value must be a URL with the following elements:
http[s]://[‹user›[:‹password›]@]‹host›[:‹port›][/‹resource›]
Where:
http/https
: Protocol for connection to TSA.‹user›:‹password›
(optional): Credentials for connection to TSA (basic authorization).‹host›
: Hostname of TSA.‹port›
: Port for connection to TSA.‹resource›
: The resource.Applying a time-stamp requires an online connection to a time server; the firewall must be configured accordingly. If a web proxy is used (see PdfTools_Sdk_GetProxy), make sure the following MIME types are supported:
application/timestamp-query
application/timestamp-reply
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | szTimestampUrl | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_Provider_SetTimestampUrlW | ( | TPdfToolsCryptoProvidersBuiltIn_Provider * | pProvider, |
const WCHAR * | szTimestampUrl ) |
The URL of the trusted time-stamp authority (TSA) from which time-stamps shall be acquired.
The TSA must support the time-stamp protocol as defined in RFC 3161.
The property’s value must be a URL with the following elements:
http[s]://[‹user›[:‹password›]@]‹host›[:‹port›][/‹resource›]
Where:
http/https
: Protocol for connection to TSA.‹user›:‹password›
(optional): Credentials for connection to TSA (basic authorization).‹host›
: Hostname of TSA.‹port›
: Port for connection to TSA.‹resource›
: The resource.Applying a time-stamp requires an online connection to a time server; the firewall must be configured accordingly. If a web proxy is used (see PdfTools_Sdk_GetProxy), make sure the following MIME types are supported:
application/timestamp-query
application/timestamp-reply
[in,out] | pProvider | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_Provider. |
[in] | szTimestampUrl | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_GetAddTimestamp | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration | ) |
Whether to add a trusted time-stamp to the signature.
If TRUE the PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrl must be set.
Default: FALSE
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
May indicate an error in certain scenarios. For further information see the note section below.
PDFTOOLS_EXPORT TPdfToolsCrypto_HashAlgorithm PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_GetHashAlgorithm | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration | ) |
The message digest algorithm.
The algorithm used to hash the document and from which the cryptographic signature is created.
Default: ePdfToolsCrypto_HashAlgorithm_Sha256
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsCrypto_SignatureFormat PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_GetSignatureFormat | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration | ) |
The format (encoding) of the cryptographic signature Default: ePdfToolsCrypto_SignatureFormat_EtsiCadesDetached.
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT TPdfToolsCrypto_SignaturePaddingType PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_GetSignaturePaddingType | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration | ) |
The padding type of the cryptographic signature Default: ePdfToolsCrypto_SignaturePaddingType_RsaSsaPss for RSA and for ePdfToolsCrypto_SignaturePaddingType_Default ECDSA certificates.
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT TPdfToolsCrypto_ValidationInformation PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_GetValidationInformation | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration | ) |
Whether to add validation information (LTV)
For signing certificates that do not offer validation (revocation) information (OCSP or CRL), this property is ignored.
If downloading validation information fails, an error ePdfTools_Error_NotFound or ePdfTools_Error_Http is generated. See ePdfToolsSign_WarningCategory_AddValidationInformationFailed for a description of possible error causes and solutions.
Default: ePdfToolsCrypto_ValidationInformation_EmbedInDocument if the signing certificate offers validation information and ePdfToolsCrypto_ValidationInformation_None otherwise
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_SetAddTimestamp | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration, |
BOOL | bAddTimestamp ) |
Whether to add a trusted time-stamp to the signature.
If TRUE the PdfToolsCryptoProvidersBuiltIn_Provider_GetTimestampUrl must be set.
Default: FALSE
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
[in] | bAddTimestamp | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_SetHashAlgorithm | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration, |
TPdfToolsCrypto_HashAlgorithm | iHashAlgorithm ) |
The message digest algorithm.
The algorithm used to hash the document and from which the cryptographic signature is created.
Default: ePdfToolsCrypto_HashAlgorithm_Sha256
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
[in] | iHashAlgorithm | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_SetSignatureFormat | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration, |
TPdfToolsCrypto_SignatureFormat | iSignatureFormat ) |
The format (encoding) of the cryptographic signature Default: ePdfToolsCrypto_SignatureFormat_EtsiCadesDetached.
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
[in] | iSignatureFormat | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_SetSignaturePaddingType | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration, |
TPdfToolsCrypto_SignaturePaddingType | iSignaturePaddingType ) |
The padding type of the cryptographic signature Default: ePdfToolsCrypto_SignaturePaddingType_RsaSsaPss for RSA and for ePdfToolsCrypto_SignaturePaddingType_Default ECDSA certificates.
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
[in] | iSignaturePaddingType | Set value. |
PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_SignatureConfiguration_SetValidationInformation | ( | TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration * | pSignatureConfiguration, |
TPdfToolsCrypto_ValidationInformation | iValidationInformation ) |
Whether to add validation information (LTV)
For signing certificates that do not offer validation (revocation) information (OCSP or CRL), this property is ignored.
If downloading validation information fails, an error ePdfTools_Error_NotFound or ePdfTools_Error_Http is generated. See ePdfToolsSign_WarningCategory_AddValidationInformationFailed for a description of possible error causes and solutions.
Default: ePdfToolsCrypto_ValidationInformation_EmbedInDocument if the signing certificate offers validation information and ePdfToolsCrypto_ValidationInformation_None otherwise
[in,out] | pSignatureConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_SignatureConfiguration. |
[in] | iValidationInformation | Set value. |
PDFTOOLS_EXPORT TPdfToolsCrypto_HashAlgorithm PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_TimestampConfiguration_GetHashAlgorithm | ( | TPdfToolsCryptoProvidersBuiltIn_TimestampConfiguration * | pTimestampConfiguration | ) |
The message digest algorithm.
The algorithm used to hash the document and from which the time-stamp signature is created.
Note: This algorithm must be supported by the time-stamp server; many support only SHA-256.
Default: ePdfToolsCrypto_HashAlgorithm_Sha256
[in,out] | pTimestampConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_TimestampConfiguration. |
May indicate an error in certain scenarios. For further information see the note section below.
0
was returned. Retrieve specific error code by calling PdfTools_GetLastError. Get the error message with PdfTools_GetLastErrorMessage. Possible error codes:PDFTOOLS_EXPORT BOOL PDFTOOLS_CALL PdfToolsCryptoProvidersBuiltIn_TimestampConfiguration_SetHashAlgorithm | ( | TPdfToolsCryptoProvidersBuiltIn_TimestampConfiguration * | pTimestampConfiguration, |
TPdfToolsCrypto_HashAlgorithm | iHashAlgorithm ) |
The message digest algorithm.
The algorithm used to hash the document and from which the time-stamp signature is created.
Note: This algorithm must be supported by the time-stamp server; many support only SHA-256.
Default: ePdfToolsCrypto_HashAlgorithm_Sha256
[in,out] | pTimestampConfiguration | Acts as a handle to the native object of type TPdfToolsCryptoProvidersBuiltIn_TimestampConfiguration. |
[in] | iHashAlgorithm | Set value. |