SetSignProcessCNGKeyFromFile
安全與簽章
描述
從檔案載入 DER 編碼的 X.509 憑證,並將具名的 NCrypt 私密金鑰接到 PDF 簽署程序
語法
Delphi
Function TPDFlib.SetSignProcessCNGKeyFromFile(SignProcessID: Integer; Const CertificateFile, ProviderName, KeyName: WideString; UseMachineKey, AllowUI: Boolean): Integer;
ActiveX
Function PDFlib::SetSignProcessCNGKeyFromFile(SignProcessID As Long, CertificateFile As String, ProviderName As String, KeyName As String, UseMachineKey As Long, AllowUI As Long) As Long
DLL
int DLSetSignProcessCNGKeyFromFile(int InstanceID, int SignProcessID, const wchar_t* CertificateFile, const wchar_t* ProviderName, const wchar_t* KeyName, int UseMachineKey, int AllowUI);
參數
| CertificateFile | DER 編碼 RSA 或 ECDSA X.509 憑證的路徑 |
|---|---|
| ProviderName | Windows 金鑰儲存提供者名稱;空字串表示 Microsoft 軟體提供者 |
| KeyName | 提供者能理解的持久鍵名稱 |
| UseMachineKey | true 或非零表示使用機器金鑰範圍 |
| AllowUI | true 或非零表示允許提供者互動 |
傳回值
| 1 | 憑證已讀取,設定已附加 |
|---|---|
| 0 | 檔案、process id 或鍵名無效 |
備註
DLL 另匯出 DLSetSignProcessCNGKeyFromFileA,供 ANSI 路徑與名稱使用
憑證位元組由簽署程序保留,私鑰則留在其提供者內