PAdES B-B and B-T signing is part of every edition; the B-LT and B-LTA levels require the Enterprise edition (link FPdfEnterprise with Lib\Enterprise on the search path), otherwise they raise EPdfEnterpriseRequired before any output is written; see the edition matrix
function SignPadesForDigest(const FileName: string; const Options: TPadesSignOptions; DigestAlgorithm: TCmsDigestAlgorithm): Boolean;
Appends an incremental approval or certification signature update, then stores it to FileName, computing the document digest with the algorithm named by DigestAlgorithm and declaring that same algorithm inside the CMS signature
| FileName | The output file the signed document is written to |
| Options | Signature details structure specifying certificates, levels, optional dictionary keys, and field constraints |
| DigestAlgorithm | Message digest used for the document, the signed attributes, and the signature algorithm; one of cdaSha256, cdaSha3_256, cdaSha3_384 or cdaSha3_512 |
Active to be TruecdaSha256 keeps the behaviour of SignPadesdigestAlgorithm, the messageDigest signed attribute (32, 48 or 64 octets), the signer's signatureAlgorithm, and the RSASSA-PSS hash and salt length all follow itcertHash stays SHA-256 regardless of the choice, as RFC 5035 defines it independently of the SignedData digestSHA3-256 algorithm, first shipped with Windows 11 24H2; test with WinSha3DigestAvailable before offering the choiceDigestAlgorithm raises EPadesCrypto instead of producing a signature whose declared algorithms disagree
var
Opts: TPadesSignOptions;
begin
if not Pdf1.Active then Exit;
if not WinSha3DigestAvailable then Exit;
try
Opts := TPadesSignOptions.Default;
Opts.CertificateThumbprint := 'a1b2c3d4e5';
Pdf1.SignPadesForDigest('signed-sha3.pdf', Opts, cdaSha3_256);
except
on E: EPadesCrypto do ShowMessage(E.Message);
end;
end;