PdfSignatureVerifier Class
Finds and checks the signatures of a document (ISO 32000-2, 12.8): for each signature field, the bytes the signature covers are hashed and compared with the digest that was signed, the CMS signature is checked with the certificate of the signer, the RFC 3161 time stamps are checked, and the changes made after the signature are compared with what its certification and its field lock allow.
public static class PdfSignatureVerifierRemarks
The information of a signature is read from the revision it signs: a change of the signature dictionary appended after it does not change what is reported, and is reported in PdfSignatureInfo.Modifications.
Methods
| Name | Description |
|---|---|
| GetValidationData(byte[], PdfReadOptions?) | Reads the validation data of the document security store of a file (ISO 32000-2, 12.8.4.3). |
| Verify(byte[], PdfReadOptions?) | Checks the signatures of a file. |
GetValidationData(byte[], PdfReadOptions?)
PdfSignatureVerifier.csReads the validation data of the document security store of a file (ISO 32000-2, 12.8.4.3).
public static PdfValidationData GetValidationData(byte[] file, PdfReadOptions? options = null)Parameters
filebyte[]- The file.
optionsPdfReadOptions?- The options to read the file with, such as the password of an encrypted file.
Returns
PdfValidationData The certificates, the revocation lists and the OCSP responses of the store; empty when the document has none.
Exceptions
InvalidPdfContentException- The data is not a PDF document.
PdfPasswordException- The document is encrypted, and the password of the options does not open it.
Verify(byte[], PdfReadOptions?)
PdfSignatureVerifier.csChecks the signatures of a file.
public static IReadOnlyList<PdfSignatureInfo> Verify(byte[] file, PdfReadOptions? options = null)Parameters
filebyte[]- The file.
optionsPdfReadOptions?- The options to read the file with, such as the password of an encrypted file.
Returns
IReadOnlyList<PdfSignatureInfo> The signatures, in the order of the fields of the interactive form.
Exceptions
InvalidPdfContentException- The data is not a PDF document.
PdfPasswordException- The document is encrypted, and the password of the options does not open it.