Discuss this help topic in SecureBlackbox Forum

Verify the X.509 certificate signatures

First load the document as described in the corresponding how-to article.

Check the value of Signed property of TElPDFDocument to find out whether the document is signed.

The next step is to validate the signatures, made over the document. To get the number of signatures, use SignatureCount property of TElPDFDocument class. You can access the individual signatures using Signatures property of TElPDFDocument class. Signatures property returns the instances of TElPDFSignature class.

You can read signature properties from the signature instances.

To validate the signature, use Validate() method of TElPDFSignature class. The method checks that the signed data has not been altered. This method doesn't validate the certificates, used to sign the data. To validate the certificates, access them via Certificates property of the instance of TElPDFPublicKeySecurityHandler class. This instance is accessible via Handler property of TElPDFSignature class. Then perform certificate validation as described in the corresponding how-to article.

If the signature is timestamped, you might need to check the timestamp before relying on them during signature validation. See more about timestamp validation in the corresponding how-to article

To access the signed data, use GetSignedVersion() method of TElPDFSignature class.

To remove all signatures (and obtain the unsigned document) use ClearSignatures method of TElPDFDocument class.

If you removed the signatures, save and close the modified document using Close() method.

How To articles about PDF signing

Discuss this help topic in SecureBlackbox Forum