SetPublicKeyDecryptionStore

安全與簽章

描述

設定後續載入文件時,搜尋相符收件者私密金鑰的 Windows 憑證存放區

篩選器指定不同收件者時,憑證存放區必須為每個加密篩選器含有對應的私鑰

若某個篩選器沒有對應的私鑰,即使相符的憑證存在,文件載入與直接存取仍會失敗,LastErrorCode 為 421

同一篩選器內多個私鑰符合收件者封裝時,該篩選器採用所有相符封裝共有的權限

語法

Delphi

Function TPDFlib.SetPublicKeyDecryptionStore(Const StoreName: WideString; UseMachineStore: Integer): Integer;

ActiveX

Function PDFlib::SetPublicKeyDecryptionStore(StoreName As String, UseMachineStore As Long) As Long

DLL

int DLSetPublicKeyDecryptionStore(int InstanceID, const wchar_t* StoreName, int UseMachineStore);
int DLSetPublicKeyDecryptionStoreA(int InstanceID, const char* StoreName, int UseMachineStore);

參數

StoreNameWindows 憑證存放區名稱,例如 MY
UseMachineStore本機(local machine)存放區用非零值;目前使用者存放區用零

傳回值

1存放區選擇已保留
0存放區名稱為空

備註

DLL 另外匯出 ANSI 字串用的 DLSetPublicKeyDecryptionStoreA

另請參閱

SetPublicKeyDecryptionPFX, ClearPublicKeyDecryptionCredential