SetPAdESSignatureCMSBytes

安全與簽章

需要 Enterprise 版本。在 Delphi、C++Builder 與 Lazarus 程式碼中,請以 TPDFlibEnterprise(PDFlibEnterprise 單元)建立程式庫;Enterprise DLL 與 ActiveX 組建原樣提供。其他版本保留此方法,方法會傳回 0、空字串或 False,並將 LastErrorCode 設為 900(PDFLIB_ERROR_ENTERPRISE_REQUIRED)

描述

為所選簽章的 /Contents 預留位置暫存完整的取代用 CMS DER 位元組

這是給刻意執行通用 CMS 改寫之呼叫端的進階逃生口

一般的 PAdES-B-T 建立流程請用 SetPAdESSignatureTimeStampToken,讓程式庫驗證 RFC 3161 權杖並安全地重建所選的 SignerInfo

語法

Delphi

Function TPDFlib.SetPAdESSignatureCMSBytes(
  STSProcessID: Integer; Const NewCMSBytes: AnsiString): Integer; Virtual;

ActiveX

Function PDFlib::SetPAdESSignatureCMSBytes(STSProcessID As Long, NewCMSBytes As Variant) As Long

DLL

int DLSetPAdESSignatureCMSBytes(int InstanceID, int STSProcessID, const char* NewCMSBytes, int NewCMSBytesLength);

參數

STSProcessID由 NewPAdESSignatureTimeStampProcessFrom* 其中一個函式傳回的簽章時間戳流程控制代碼
NewCMSBytes完整置換用的 CMS DER;長度不得超過原始簽章建立時預留的 /Contents 佔位空間,否則最後的作業會傳回錯誤 13

傳回值

程序存在時傳回 1;process 識別碼無效則傳回 0

備註

取代內容必須放得進原始簽章建立前保留的預留位置,否則最終操作傳回錯誤 13

另請參閱

SetPAdESSignatureTimeStampToken, SetSignProcessReserveContentsBytes