SetPublicKeyDecryptionPFX
安全和签名
描述
设置后续 LoadFromFile、LoadFromStream 和 LoadFromString 调用使用的 PKCS #12 PFX 凭据
语法
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);
参数
| PFXFileName | 包含收件人私钥的 PFX 路径 |
|---|---|
| PFXPassword | 用于保护 PFX 的密码 |
| UseMachineKeyset | 机器密钥集使用非零值,用户密钥集使用零 |
返回值
| 1 | 凭据已通过验证并保留 |
|---|---|
| 0 | PFX 或密码无效,且 LastErrorCode 返回 420 |
备注
该凭据会在文档加载之间保持有效,直至被替换或清除
DLL 还会导出用于 ANSI 字符串的 DLSetPublicKeyDecryptionPFXA
另请参阅
SetPublicKeyDecryptionStore、ClearPublicKeyDecryptionCredential、GetPubSecStatus