SetPAdESSignatureCMSBytes
Security and Signatures
Requires the Enterprise edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibEnterprise (unit PDFlibEnterprise); the Enterprise DLL and ActiveX builds provide it unchanged; other editions keep the method, which returns 0, an empty string or False and sets LastErrorCode to 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)
Description
Stages complete replacement CMS DER bytes for the selected signature /Contents placeholder
This is an advanced escape hatch for callers that deliberately perform a general CMS rewrite
For normal PAdES-B-T creation, use SetPAdESSignatureTimeStampToken so the library validates the RFC 3161 token and safely rebuilds the selected SignerInfo
Syntax
Delphi
Function TPDFlib.SetPAdESSignatureCMSBytes(
STSProcessID: Integer; Const NewCMSBytes: AnsiString): Integer; Virtual;ActiveX
Function PDFlib::SetPAdESSignatureCMSBytes(STSProcessID As Long, NewCMSBytes As Variant) As LongDLL
int DLSetPAdESSignatureCMSBytes(int InstanceID, int STSProcessID, const char* NewCMSBytes, int NewCMSBytesLength);
Parameters
| STSProcessID | Signature timestamp process handle returned by one of the NewPAdESSignatureTimeStampProcessFrom* functions |
|---|---|
| NewCMSBytes | Complete replacement CMS DER; its length must not exceed the /Contents placeholder reserved when the original signature was created, otherwise the final operation returns error 13 |
Return values
Returns 1 when the process exists and 0 for an invalid process identifier
Remarks
The replacement must fit the placeholder reserved before the original signature was created, otherwise the final operation returns error 13
See also
SetPAdESSignatureTimeStampToken, SetSignProcessReserveContentsBytes