AddPublicKeyRecipientFromPFX

Security and signatures

Description

Adds the certificate carrying a private-key association from a PKCS #12 PFX file as a public-key encryption recipient

Syntax

Delphi

Function TPDFlib.AddPublicKeyRecipientFromPFX(Const PFXFileName, PFXPassword: WideString; UseMachineKeyset, Permissions: Integer): Integer;

ActiveX

Function PDFlib::AddPublicKeyRecipientFromPFX(PFXFileName As String, PFXPassword As String, UseMachineKeyset As Long, Permissions As Long) As Long

DLL

int DLAddPublicKeyRecipientFromPFX(int InstanceID, const wchar_t* PFXFileName, const wchar_t* PFXPassword, int UseMachineKeyset, int Permissions);

Parameters

PFXFileNamePath to the PKCS #12 PFX file
PFXPasswordPassword protecting the PFX file
UseMachineKeysetUse a nonzero value to import keys through the machine keyset or zero for the user keyset
PermissionsPermission mask returned by EncodePermissions

Return values

1The recipient certificate was added
0The PFX, password, permissions, or document state was invalid

Remarks

The private key is used only to identify the leaf certificate while adding the recipient and is not embedded in the PDF

The DLL also exports DLAddPublicKeyRecipientFromPFXA for ANSI strings

See also

SetPublicKeyDecryptionPFX, EncryptPublicKey