SetSignProcessSignaturePolicy

Security and Signatures

Description

Sets the CAdES signature-policy-identifier signed attribute for the PAdES-B-B signing path

Syntax

Delphi

Function TPDFlib.SetSignProcessSignaturePolicy(SignProcessID: Integer; Const PolicyOID, PolicyHashHex: WideString; HashAlgorithm: Integer): Integer;

Parameters

SignProcessIDValue returned by one of the NewSignProcessFrom* functions
PolicyOIDDotted-decimal OID identifying the policy document. Pass an empty value to clear the attribute
PolicyHashHexHex-encoded hash of the policy document
HashAlgorithmDigest code: 0 auto/SHA-256, 1 SHA-1, 2 SHA-256, 3 SHA-384, 4 SHA-512, 5 SHA3-256, 6 SHA3-384, 7 SHA3-512

Return values

Returns 1 when the process exists and the hash-algorithm code is accepted; returns 0 otherwise

Remarks

Odd-length or non-hex policy hash input is truncated at the first invalid pair. The attribute is emitted only for the ETSI.CAdES.detached SubFilter path

The default native non-Windows PFX provider supports this attribute with RSA, RSA-PSS and ECDSA signing; a nonempty Reason combined with commitment or policy attributes fails standard signing-process validation, and an empty PAdES Reason entry is omitted

See Native CMS signed attributes for native processing limits

See also

SetSignProcessCustomSubFilter, SetSignProcessDigestAlgorithm