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 以外的方案会通过 GetTimeStampError 报告,而不会引发异常

可与 SetTimeStampOptions 配合使用,以选择摘要算法以及授权方是否应在令牌中嵌入其签名链

示例

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

另请参阅

SetTimeStampOptions, FetchTimeStampToken, ApplyPAdESSignatureTimeStamp