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
| PFXFileName | Path to the PKCS #12 PFX file |
|---|---|
| PFXPassword | Password protecting the PFX file |
| UseMachineKeyset | Use a nonzero value to import keys through the machine keyset or zero for the user keyset |
| Permissions | Permission mask returned by EncodePermissions |
Return values
| 1 | The recipient certificate was added |
|---|---|
| 0 | The 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