GetSignatureCertificateChainDER

Digital signatures

Description

Returns one certificate from the path a signature carries, DER encoded.

Syntax

Delphi

Function TPDFlib.GetSignatureCertificateChainDER(Const InputFile, Password, FieldName: WideString; SignerIndex, ChainIndex: Integer): AnsiString;

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.
ChainIndexZero-based position in the path; 0 is the signer, higher indices are its issuers.

Return values

CertificateThe certificate at that position.
Empty stringThe index is past the path, or the file or field could not be read.

Remarks

This reads structure only and verifies nothing: it reports the certificate the signature names, not a certificate that has been checked to have produced a valid signature.

Each call reads the file, so a caller walking the whole path should read the length once with GetSignatureCertificateChainLength and keep the count.

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

See also

GetSignatureCertificateChainLength, GetSignatureSignerCertificateDER