DigitalSignature Method
Add digital invisible to PDF output.
Object.DigitalSignature(tcSignature [, tcPassword [, tnAccessPermissions [, tcSignatureName [, tcSignatureContactInfo [, tcSignatureLocation [, tcSignatureReason ]]]]]])
Object.DigitalSignature(tcSignature [, tcPassword [, tnAccessPermissions [, tcSignatureName [, tcSignatureContactInfo [, tcSignatureLocation [, tcSignatureReason [, tcSignatureSRC [, tcDiggestAlgorithm]]]]]]]])
Parameters
cSignature
Depend on cSignatureSrc parameter.
cPassword
The password protecting the private key stored in the .pfx file
nAccessPermissions
per PDF specification:
Value | Description |
---|---|
1 | No changes to the document are permitted; any change to the document invalidates the signature. |
2 | Permitted changes are filling in forms, instantiating page templates, and signing; other changes invalidate the signature (this is the default value). |
3 | Permitted changes are the same as for 2, as well as annotation creation, deletion and modification; other changes invalidate the signature. |
cSignatureName
per PDF specification: The name of the person or authority signing the document. This value should be used only when it is not possible to extract the name from the signature; for example, from the certificate of the signer.
cSignatureContactInfo
per PDF specification: Information provided by the signer to enable a recipient to contact the signer to verify the signature; for example, a phone number.
cSignatureLocation
per PDF specification: The CPU host name or physical location of the signing.
cSignatureReason
per PDF specification: The reason for the signing, such as ( I agree ... ).
cSignatureSrc
Signature source can be:
Value | Description |
---|---|
'FILE' | (Default) The .pfx file. pfx, the "Personal Information Exchange File". This file contains the public certificate and (password protected) private key. You get this file from a certificate authority or you can generate your own for testing, which for example, OpenSSL (http://www.slproweb.com/products/Win32OpenSSL.html). XFRX comes with a sample pfx that you can use for testing. |
'HASH' | Certificate's hash, in HEX string. A string can contains spaces. XFRX load certicate by hash from user certificate store. |
'NAME' | Certificate's subject name. XFRX load certicate by subject name from user certificate store. |
cDiggestAlgorithm
Diggest algorithm can be:
Value | Description |
---|---|
'SHA1' | version 1 |
'SHA256' | (Default) version 2 (256 bits) |
'SHA384' | version 2 (384 bits) |
'SHA512' | version 2 (512 bits) |
Remarks
Applies To: XFRX#INIT, XFRX#LISTENER, PDFL#INIT, oXFRX
XFRX version: 24.0 for oXFRX
Examples
LOCAL m.loXFRX, m.lnRetVal m.loXFRX = EVALUATE([xfrx("XFRX#INIT")]) m.loXFRX.DigitalSignature("my.pfx", "password") m.lnRetVal = m.loXFRX.SetParams("output.pdf",,,,,,"PDF") IF m.lnRetVal = 0 m.loXFRX.ProcessReport("report1") m.loXFRX.ProcessReport("report2") ELSE ? m.lnRetVal, m.loXFRX.ErrorMessage(m.lnRetVal) ENDIF RELE m.loXFRX
LOCAL m.loXFRX, m.lnRetVal m.loXFRX = EVALUATE([xfrx("XFRX#INIT")]) m.loXFRX.DigitalSignature("00 01 02.... 55", "password", 0, "", "", "", "", "HASH") m.lnRetVal = m.loXFRX.SetParams("output.pdf",,,,,,"PDF") IF m.lnRetVal = 0 m.loXFRX.ProcessReport("report1") m.loXFRX.ProcessReport("report2") ELSE ? m.lnRetVal, m.loXFRX.ErrorMessage(m.lnRetVal) ENDIF RELE m.loXFRX