PdfSignature

A digital signature in a signature field (ISO 32000-1, 12.8): what its signature dictionary says, and validate to check it. PdfDocument.signatures lists the signatures of a document.

Properties

Link copied to clipboard

The signed bytes of the file (/ByteRange): an offset and a length for each part. The gap between the parts holds the signature itself.

Link copied to clipboard

The permission level when this is a certification signature (/DocMDP, ISO 32000-1, 12.8.2.2): 1 allows no change, 2 allows filling in forms and signing, and 3 also allows annotations. Null for an approval signature.

Link copied to clipboard

How to reach the signer (/ContactInfo), or null.

Link copied to clipboard

The signature field that holds this signature.

Link copied to clipboard

True for a document timestamp (/Type /DocTimeStamp, ISO 32000-2, 12.8.5). A timestamp authority signs it to prove that the document existed at a time. It names no person.

Link copied to clipboard

Where the document was signed (/Location), or null.

Link copied to clipboard
val name: String?

The signer's name as the signing application wrote it (/Name). PdfSignatureValidation.signer is the checked name.

Link copied to clipboard

Why the document was signed (/Reason), or null.

Link copied to clipboard

When the document was signed, as the signing application wrote it (/M). Nothing checks this time.

Link copied to clipboard

The encoding of the signature (/SubFilter), such as adbe.pkcs7.detached or ETSI.CAdES.detached.

Functions

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun validate(trustAnchors: List<ByteArray> = emptyList(), revocationData: List<ByteArray> = emptyList()): PdfSignatureValidation

Checks the signature against the file. trustAnchors are the DER encodings of the certificates the caller trusts. An entry that is not a certificate is ignored. The check hashes the signed bytes, which are almost the whole file, so run it off the main thread.