SetPublicKeyDecryptionPFX
安全與簽章
描述
設定後續文件載入與唯讀直接存取使用的 PKCS #12 PFX 憑證資料,適用於含加密篩選器的公鑰 PDF
PDF 宣告多個加密篩選器時,憑證資料必須為每個篩選器提供對應的私鑰。文件層級權限只含每個加密篩選器都授予的權限
同一篩選器內多個相符收件者封裝授予不同權限時,該篩選器採用所有相符項共有的權限
語法
Delphi
Function TPDFlib.SetPublicKeyDecryptionPFX(Const PFXFileName, PFXPassword: WideString; UseMachineKeyset: Integer): Integer;
ActiveX
Function PDFlib::SetPublicKeyDecryptionPFX(PFXFileName As String, PFXPassword As String, UseMachineKeyset As Long) As Long
DLL
int DLSetPublicKeyDecryptionPFX(int InstanceID, const wchar_t* PFXFileName, const wchar_t* PFXPassword, int UseMachineKeyset);
int DLSetPublicKeyDecryptionPFXA(int InstanceID, const char* PFXFileName, const char* PFXPassword, int UseMachineKeyset);
參數
| PFXFileName | 含收件者私密金鑰的 PFX 路徑 |
|---|---|
| PFXPassword | 保護 PFX 的密碼 |
| UseMachineKeyset | 機器金鑰組用非零值;使用者金鑰組用零 |
傳回值
| 1 | 憑證已驗證並保留 |
|---|---|
| 0 | PFX 或密碼無效,LastErrorCode 傳回 420 |
備註
憑證在多次文件載入之間保持有效,直到被取代或清除
DLL 另外匯出 ANSI 字串用的 DLSetPublicKeyDecryptionPFXA
另請參閱
SetPublicKeyDecryptionStore, ClearPublicKeyDecryptionCredential, GetPubSecStatus