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 | 來源 PDF 檔案路徑 |
OutputPDFPath | 簽署後 PDF 的目的路徑 |
Selector | 用來選擇簽署憑證的憑證儲存區選擇器 |
Options | CMS 簽署選項,控制摘要、簽章中繼資料、時間戳記與相關政策 |
InputStream | 定位在 PDF 開頭的來源串流 |
OutputStream | 接收簽署 PDF 的目的串流 |
傳回值
找到憑證且簽署 PDF 寫入成功時傳回 True
使用說明
- 輸入與輸出的檔案路徑或串流必須不同
- 目前處理程序必須能存取 Windows 憑證私密金鑰
- 此 helper 需要 Delphi 2009 或更新版本
Options.DigestAlgorithm - CNG ECDSA 簽章會從 Windows 原始座標格式轉換為 CMS 要求的 DER 形式
- Windows 版本與金鑰儲存提供者必須支援所選的 SHA-3 演算法
- 舊式 CryptoAPI 金鑰支援搭配 SHA-256、SHA-384 或 SHA-512 的 RSA PKCS#1 v1.5,並明確拒絕 SHA-3、RSA-PSS 與 ECDSA
- 本輔助方法需要 Delphi 2009 或更新版本
相關 API
- THotPDF
- THPDFPage
- 目錄