SetTimeStampServer

數位簽章

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

描述

選擇內建用戶端連線的 RFC 3161 時戳機構

語法

Delphi

Function TPDFlib.SetTimeStampServer(Const URL, UserName, Password: WideString): Integer; Virtual;

ActiveX

Function PDFlib::SetTimeStampServer(URL As String, UserName As String, Password As String) As Long

DLL

int DLSetTimeStampServer(int InstanceID, const wchar_t* URL, const wchar_t* UserName, const wchar_t* Password);
int DLSetTimeStampServerA(int InstanceID, const char* URL, const char* UserName, const char* Password);

參數

URL機構端點;必須是 http 或 https 位址
UserName基本驗證使用者名稱;匿名機構則傳空字串
Password基本驗證密碼

傳回值

1設定已儲存

備註

位址在實際送出請求時才驗證,因此 http、https 之外的 scheme 會透過 GetTimeStampError 回報,而不是直接拋例外

搭配 SetTimeStampOptions 選擇摘要演算法,以及機構是否要把簽署鏈嵌進權杖

範例

PDF.SetTimeStampServer('https://tsa.example.com/tsa', '', '');
PDF.SetTimeStampOptions(2, 1, 1, 15000, '');

另請參閱

SetTimeStampOptions, FetchTimeStampToken, ApplyPAdESSignatureTimeStamp