ApplyPAdESLongTermArchiveValidation
数字签名
需要 Enterprise 版。在 Delphi、C++Builder 和 Lazarus 代码中,请将库创建为 TPDFlibEnterprise(单元 PDFlibEnterprise);Enterprise 版的 DLL 和 ActiveX 构建原样提供该类。其他版本保留此方法,它返回 0、空字符串或 False,并将 LastErrorCode 设置为 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)
描述
一次调用将已签名 PDF 提升为 PAdES B-LTA:先执行 B-LT 验证材料升级,再追加 /SubFilter /ETSI.RFC3161 的 /DocTimeStamp 签名,其令牌从 SetTimeStampServer 配置的 TSA 获取,结果写入文件
语法
Delphi
Function TPDFlib.ApplyPAdESLongTermArchiveValidation(Const InputFile, Password, OutputFile, FieldName: WideString; Options: Integer): Integer; Virtual;ActiveX
Function PDFlib::ApplyPAdESLongTermArchiveValidation(InputFile As String, Password As String, OutputFile As String, FieldName As String, Options As Long) As LongDLL
int DLApplyPAdESLongTermArchiveValidation(int InstanceID, const wchar_t* InputFile, const wchar_t* Password, const wchar_t* OutputFile, const wchar_t* FieldName, int Options);
int DLApplyPAdESLongTermArchiveValidationA(int InstanceID, const char* InputFile, const char* Password, const char* OutputFile, const char* FieldName, int Options);参数
| InputFile | 已签名的 PDF |
|---|---|
| Password | 打开所用密码,可为空字符串 |
| OutputFile | 要写出的 B-LTA PDF |
| FieldName | 待处理的签名字段;留空则把每个签名处理进同一个修订 |
| Options | PADES_LTV_* 位掩码,其文档说明见 ApplyPAdESLongTermValidation;0 选择 PADES_LTV_DEFAULT |
返回值
| 1 | 提升成功 |
|---|---|
| 2 | 输入文件无法读取 |
| 3 | B-LT 阶段失败;GetPAdESLTVError 返回原因 |
| 4 | 未配置 TSA 或 TSA 拒绝请求;GetTimeStampError 保存 TSA 细节 |
| 10 | 输出无法写入 |
| 11 | 文档时间戳无法应用 |
另请参阅
ApplyPAdESLongTermValidation, SetTimeStampServer, SetPAdESSignatureTimeStampDigestAlgorithm