THotPDF.SignPDFWithSystemCertificate Method
方法摘要: THotPDF.SignPDFWithSystemCertificate Method
声明
class function SignPDFWithSystemCertificate(const InputPDFPath, OutputPDFPath: string; const Selector: THPDFCertificateStoreSelector; const Options: THPDFCMSSignOptions): boolean; overload; static;
class function SignPDFWithSystemCertificate(InputStream, OutputStream: TStream; const Selector: THPDFCertificateStoreSelector; const Options: THPDFCMSSignOptions): boolean; overload; static;
单元
HPDFDoc
参数
| 名称 | 用途 |
|---|---|
InputPDFPath | Source PDF file path |
OutputPDFPath | 已签名 PDF 的目标路径 |
Selector | 用于选择签名证书的证书存储选择器 |
Options | CMS 签名选项,控制摘要、签名元数据、时间戳及相关策略 |
InputStream | 定位在 PDF 起始位置的源流 |
OutputStream | 接收已签名 PDF 的目标流 |
返回值
找到证书且已签名 PDF 写入成功时返回 True
使用说明
- 输入和输出的文件路径或流必须不同
- 当前进程必须能够访问 Windows 证书的私钥
- 该辅助方法要求 Delphi 2009 或更高版本
Options.DigestAlgorithm - CNG ECDSA 签名会从 Windows 原始坐标格式转换为 CMS 要求的 DER 形式
- Windows 版本和密钥存储提供程序必须实现所选的 SHA-3 算法
- 旧版 CryptoAPI 密钥支持 RSA PKCS#1 v1.5 搭配 SHA-256、SHA-384 或 SHA-512,并显式拒绝 SHA-3、RSA-PSS 和 ECDSA
- 该辅助方法需要 Delphi 2009 或更高版本