SetSignatureFieldSeedValue
Security and signatures
Description
Creates or replaces the /SV seed-value dictionary of an unsigned signature field and selects which constraints a signing operation must enforce
Syntax
Delphi
Function TPDFlib.SetSignatureFieldSeedValue(Index, Flags: Integer; Const SubFilters, DigestMethods, Reasons: WideString; Const LegalAttestations: WideString= ''): Integer;
ActiveX
Function PDFlib::SetSignatureFieldSeedValue(Index As Long, Flags As Long, SubFilters As String, DigestMethods As String, Reasons As String) As Long
DLL
int DLSetSignatureFieldSeedValue(int InstanceID, int Index, int Flags, const wchar_t* SubFilters, const wchar_t* DigestMethods, const wchar_t* Reasons);
int DLSetSignatureFieldSeedValueA(int InstanceID, int Index, int Flags, const char* SubFilters, const char* DigestMethods, const char* Reasons);
Parameters
| Index | One-based form-field index identifying an unsigned signature field |
|---|---|
| Flags | Bit mask selecting required constraints: PDF_SIGNATURE_SEED_FILTER (1) filter, PDF_SIGNATURE_SEED_SUBFILTER (2) SubFilter, PDF_SIGNATURE_SEED_VERSION (4) seed-value version, PDF_SIGNATURE_SEED_REASON (8) reason, PDF_SIGNATURE_SEED_LEGAL_ATTESTATION (16) legal attestation, PDF_SIGNATURE_SEED_ADD_REV_INFO (32) revocation information, and PDF_SIGNATURE_SEED_DIGEST_METHOD (64) digest method |
| SubFilters | Semicolon-delimited allowed SubFilter names such as ETSI.CAdES.detached or adbe.pkcs7.detached |
| DigestMethods | Semicolon-delimited allowed digest names: SHA1, SHA256, SHA384, SHA512, SHA3-256, SHA3-384, or SHA3-512 |
| Reasons | Semicolon-delimited allowed signing reasons; an empty list or . prohibits a custom reason when the reason flag is required |
| LegalAttestations | Semicolon-delimited allowed legal attestation names for the /LegalAttestation seed-value constraint; empty by default; compatible SetSignatureFieldSeedValueEx entry points expose this argument through DLL and ActiveX |
Return values
| 1 | The seed-value dictionary was written |
|---|---|
| 0 | The field, flags or a required value list was invalid, or an indirect seed object could not be registered |
Remarks
The original DLL and ActiveX signatures retain the empty LegalAttestations default; use the Ex entry points to supply this list
The method writes seed-value version 2 and filter Adobe.PPKLite
The SV value is an indirect dictionary reference, as required by the signature field format; replacement is published after object registration succeeds, and unavailable registration leaves the prior field value intact
Seed reading supports existing direct dictionaries as a compatibility path as well as saved indirect dictionaries, referenced members and array elements; reference chains are bounded to 32 hops, and pending replacements and cached edits retain their current values
Required constraints that this release cannot enforce are rejected when the dictionary is authored and fail closed when read from an existing PDF
When a seeded field is signed, the signing process enforces Filter, SubFilter, V, Reasons, LegalAttestation, AddRevInfo and DigestMethod, the /MDP permission level (0 for an approval signature, 1 to 3 for a certification at that level), a required /LockDocument (true needs a level 1 certification, false forbids one), and the certificate constraints Subject, Issuer (the issuer may sit anywhere in the chain the signing identity carries), OID (certificate policies), SubjectDN (every attribute of one listed name, compared without case) and KeyUsage. A required /AppearanceFilter is refused because named appearances are not applied. /TimeStamp is not checked at signing time: apply the signature time stamp afterwards with ApplyPAdESSignatureTimeStamp. A violation stops the process with result 13 and GetSignProcessSeedValueError names the constraint
The ANSI DLL variant is DLSetSignatureFieldSeedValueA
See also
AddSignatureFieldSeedCertificate, ClearSignatureFieldSeedValue, GetSignProcessSeedValueError