GetSignatureCertificateChainLength

Digital signatures

Description

Returns the length of the certification path a signature carries for one signer.

Syntax

Delphi

Function TPDFlib.GetSignatureCertificateChainLength(Const InputFile, Password, FieldName: WideString; SignerIndex: Integer): Integer;

Parameters

InputFileThe signed PDF.
PasswordThe password to open it, or an empty string.
FieldNameA signature field name as reported by the signature enumeration.
SignerIndexZero-based signer.

Return values

LengthThe number of certificates in the path, signer first.
0The signer or its certificate could not be read.

Remarks

Only certificates the signature itself embeds are used to build the path, so a path that stops short of a self-issued certificate means the remaining issuers have to be fetched through the addresses GetCertificateIssuerURLs reports. The path is not padded to look complete.

The document is read with a shared handle, so this answers while a verifier or viewer already holds the file open.

See also

GetSignatureCertificateChainDER, GetCertificateIssuerURLs