GetSignatureSignerCertificateDER
Digital signatures
Description
Returns the certificate that produced a signature, DER encoded.
Syntax
Delphi
Function TPDFlib.GetSignatureSignerCertificateDER(Const InputFile, Password, FieldName: WideString; SignerIndex: Integer): AnsiString;Parameters
| InputFile | The signed PDF. |
|---|---|
| Password | The password to open it, or an empty string. |
| FieldName | A signature field name as reported by the signature enumeration. |
| SignerIndex | Zero-based signer, for the rare signature that carries more than one. |
Return values
| Certificate | The signer certificate bytes. |
|---|---|
| Empty string | The signer or its certificate is absent, or the file or field could not be read. |
Remarks
The signer is matched out of the embedded set whether the signature identifies it by issuer and serial number or by subject key identifier.
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.