SetPublicKeyDecryptionPFX

Security and signatures

Description

Sets the PKCS #12 PFX credential used by subsequent document loads and read-only Direct Access for public-key PDFs with crypt filters

When a PDF declares multiple encrypted filters, the credential must provide a matching private key for each filter. Document-level permissions include only the permissions granted by every encrypted filter

When multiple matching recipient envelopes within one filter grant different permissions, that filter uses the permissions shared by all matches

Syntax

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);

Parameters

PFXFileNamePath to a PFX containing a recipient private key
PFXPasswordPassword protecting the PFX
UseMachineKeysetUse a nonzero value for the machine keyset or zero for the user keyset

Return values

1The credential was validated and retained
0The PFX or password was invalid and LastErrorCode returns 420

Remarks

The credential remains active across document loads until replaced or cleared

The DLL also exports DLSetPublicKeyDecryptionPFXA for ANSI strings

See also

SetPublicKeyDecryptionStore, ClearPublicKeyDecryptionCredential, GetPubSecStatus