VerifySignatureByName

security and signatures

Requires the Enterprise edition — part of the Enterprise signature verification surface in TPDFlibSignatureVerifier (unit PDFlibEntSignVerify)

Description

Validates the signature in the named field for the selected CMS signer: permission constraints are parsed, the ByteRange is validated, and the signed bytes are checked cryptographically.

Only the adbe.pkcs7.detached, ETSI.CAdES.detached, adbe.pkcs7.sha1, and ETSI.RFC3161 subfilters take the crypto path; a field with any other subfilter yields vsUnknown.

The adbe.pkcs7.sha1 variant verifies the legacy SHA1-wrapped digest form, and an ETSI.RFC3161 field is verified as a document timestamp against its ByteRange data with cache-only revocation.

Syntax

Delphi

Function TPDFlibSignatureVerifier.VerifySignatureByName(Const FieldName: WideString; SignerIndex: Integer;
  Out Report: TPDFlibSignatureVerificationReport): TPDFlibSignatureVerifierResult;

Parameters

FieldNameFully qualified name of the signature field
SignerIndexZero-based CMS signer index within the signature
ReportReceives the complete verification report for the selected signature

Return values

vsValidThe selected signer's signature authenticates the bytes its ByteRange covers
vsInvalidThe ByteRange is invalid (coverage is then scInvalid) or the cryptographic integrity check failed
vsUnknownNo document is open, the field does not exist, the SubFilter is unsupported, or the /Contents entry is empty

Remarks

CoverageStatus distinguishes scWholeDocument from scSignedRevision: the signed revision length equals the document length only when the signature covers the whole current file, and HasLaterRevisions flags later incremental updates.

The report also carries ContentsGapValid (the omitted bytes are exactly the hexadecimal /Contents token), RevisionEndValid (the signed revision ends at its own %%EOF), SignerCount, NativeError, and the parsed PermissionReport.

See also

TPDFlibSignatureVerifier, TPDFlibSignatureVerifierResult, GetPermissionsVerified, EnumSignatures