ApplyPAdESLongTermArchiveValidationA
数字签名
需要 Enterprise 版。在 Delphi、C++Builder 和 Lazarus 代码中,请将库创建为 TPDFlibEnterprise(单元 PDFlibEnterprise);Enterprise 版的 DLL 和 ActiveX 构建原样提供该类。其他版本保留此方法,它返回 0、空字符串或 False,并将 LastErrorCode 设置为 900 (PDFLIB_ERROR_ENTERPRISE_REQUIRED)
描述
末尾的 A 表示 ANSI(char)DLL 入口点;ActiveX/COM 接口仅公开 Unicode 形式。其行为与 ApplyPAdESLongTermArchiveValidation 相同,字符串参数按当前 SetAnsiMode 代码页解释
一次调用将已签名 PDF 提升为 PAdES B-LTA:先执行 B-LT 验证材料升级,再追加 /SubFilter /ETSI.RFC3161 的 /DocTimeStamp 签名,其令牌从 SetTimeStampServer 配置的 TSA 获取,结果写入文件
语法
Delphi
Function DLApplyPAdESLongTermArchiveValidationA(InstanceID: Integer; InputFile: PAnsiChar; Password: PAnsiChar; OutputFile: PAnsiChar; FieldName: PAnsiChar; Options: Integer): Integer;
DLL
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