EncryptPublicKey
Security and signatures
Description
Configures Adobe.PubSec public-key encryption for the selected document using its pending recipient certificates and permission groups
Syntax
Delphi
Function TPDFlib.EncryptPublicKey(Strength: Integer): Integer;
ActiveX
Function PDFlib::EncryptPublicKey(Strength As Long) As Long
DLL
int DLEncryptPublicKey(int InstanceID, int Strength);
Parameters
| Strength | Use 2 for AES-128 with AESV2 or 3 for AES-256 with AESV3 |
|---|
Return values
| 1 | Public-key encryption was configured |
|---|---|
| 0 | No recipient is configured, the strength is unsupported, or the document state is incompatible |
Remarks
The output uses /Filter /Adobe.PubSec, /SubFilter /adbe.pkcs7.s5, CMS EnvelopedData, and per-group permission payloads
PDF MAC and embedded-files-only encryption cannot be combined with this operation
See also
AddPublicKeyRecipientFromFile, SetPublicKeyDecryptionPFX, GetPubSecStatus