GetSignatureEmbeddedCertificateDER

Digital signatures

Description

Returns one certificate embedded in a signature, DER encoded.

A certificate collection extending beyond its enclosing CMS container is rejected; padding after the outer CMS object remains accepted

Syntax

Delphi

Function TPDFlib.GetSignatureEmbeddedCertificateDER(Const InputFile, Password, FieldName: WideString; CertIndex: 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.
CertIndexZero-based index into the embedded set, in encoding order.

Return values

CertificateThe certificate bytes.
Empty stringThe index is out of range, 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.

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

See also

GetSignatureEmbeddedCertificateCount, GetSignatureCertificateChainDER