SetSignProcessCustomSubFilter

Security and Signatures

Description

Sets the SubFilter entry with custom string for a digital signature process, specifying the encoding of the signature value.

Similar to SetSignProcessSubFilter but the Subfilter entry is customizable

When the supplied string begins with ETSI. (typically ETSI.CAdES.detached for PAdES baseline signatures or ETSI.RFC3161 for document time-stamps) the library automatically adds the PAdES /Extensions /ESIC <</BaseVersion /1.7 /ExtensionLevel 2>> entry to the document catalog as required by ETSI EN 319 142-1 v1.2.1 §5.6. For PDFs authored through TPDFlib the equivalent Adobe declaration (/Extensions /ADBE at /ExtensionLevel 8) is added in parallel. The injection is idempotent and never downgrades an existing higher extension level.

Selecting ETSI.CAdES.detached additionally activates the PAdES-B-B sign path: the resulting CMS payload carries the content-type (id-data) and signing-certificate-v2 (RFC 5035 / RFC 5816) authenticated attributes, and the signing-time attribute that Table 1 of EN 319 142-1 forbids is omitted because the library hands its own attribute array to CryptSignMessage. The signing certificate is identified by its SHA-256 digest (or SHA-384 / SHA-512 when SetSignProcessDigestAlgorithm selects a larger hash), and current builds also include the optional IssuerSerial tuple (issuer distinguished name plus serial number) so stricter PAdES validators can cross-check the signing certificate against their candidate chain.

Syntax

Delphi

function TPDFlib.SetSignProcessCustomSubFilter(SignProcessID: Integer; SubFilterStr: WideString): Integer;

ActiveX

Function PDFlib::SetSignProcessCustomSubFilter(SignProcessID As Long, SubFilterStr As String) As Long

DLL

int DLSetSignProcessCustomSubFilter(int InstanceID, int SignProcessID, wchar_t * SubFilterStr);

Parameters

SignProcessIDA value returned by the NewSignProcessFromFile, NewSignProcessFromStream or NewSignProcessFromString functions.
SubFilterStrCustom SubFilter string entry

Return values

0The SignProcessID parameter was invalid or the SubFilter parameter was out of range
1Success