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
| SignProcessID | Value returned by one of the NewSignProcessFrom* functions. |
|---|---|
| PolicyOID | Dotted-decimal OID identifying the policy document. Pass an empty value to clear the attribute. |
| PolicyHashHex | Hex-encoded hash of the policy document. |
| HashAlgorithm | Digest 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 PFX provider on non-Windows platforms supports this attribute with RSA, RSA-PSS and ECDSA signing; a non-empty 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 the limits of native processing
See also
SetSignProcessCustomSubFilter, SetSignProcessDigestAlgorithm