OnExternalDigestSign

Security and signatures, events

Description

Handles the final digest-signing operation for every externally configured sign process on a TPDFlib instance

Syntax

Delphi

Property OnExternalDigestSign: TPDFlibExternalDigestSignEvent Read FOnExternalDigestSign Write FOnExternalDigestSign;
Type TPDFlibExternalDigestSignEvent = Function(Sender: TObject; SignProcessID: Integer; Const Digest: AnsiString; DigestAlgorithm, SignatureAlgorithm: Integer; Var Signature: AnsiString): Boolean Of Object;

Parameters

SenderThe TPDFlib instance performing the operation
SignProcessIDThe process whose signature is requested
DigestBinary digest of the DER-encoded CMS authenticated-attributes set
DigestAlgorithmDigest code selected by SetSignProcessDigestAlgorithm
SignatureAlgorithmRaw signature format selected by SetSignProcessExternalDigestSigner
SignatureSet this output to the raw RSA signature, DER ECDSA signature, or P1363 ECDSA signature requested by SignatureAlgorithm

Return value

Return True only after Signature contains a complete result

Remarks

The event runs synchronously during EndSignProcessTo* and is not called during placeholder sizing

Exceptions, a false result, an empty signature, an oversized signature, or a signature that does not verify against the configured certificate cause the sign process to fail

See also

SetSignProcessExternalDigestSigner, SetExternalDigestSignCallback