THotPDF.EnablePubKeyEncryption

THotPDF

 

Methods  Next  CryptKeyLength

Switches document encryption to the PDF public-key security handler.

 

Delphi syntax:

procedure EnablePubKeyEncryption(const Seed: AnsiString; KeyType: THPDFKeyType = aes128; EncryptMetadata: Boolean = true);

 

C++ syntax:

void __fastcall EnablePubKeyEncryption(System::AnsiString Seed, THPDFKeyType KeyType, bool EncryptMetadata);

 

Description

EnablePubKeyEncryption emits an /Encrypt dictionary using /Filter /Adobe.PubSec. HotPDF handles the symmetric file encryption and PDF algorithm 9 key derivation, while the caller supplies the random seed and one externally built PKCS#7 envelopedData blob per recipient./Encrypt dictionary using /Filter /Adobe.PubSec and derives the file-encryption key from the exact 20-byte random seed plus the ordered recipient envelopes

 

Use AddPubKeyRecipient after this method for each recipient. Set ActivateProtection to true before writing the document. The supported KeyType values are k40, k128, and aes128; AES-256 public-key encryption is not implemented.aes256 for PDF 2.0 output with /V 5, /CFM /AESV3, 256-bit crypt-filter keys, and /SubFilter /adbe.pkcs7.s5

 

Add recipients with AddPubKeyRecipientCertificate, AddPubKeyAgreementRecipient, or the lower-level AddPubKeyRecipient method before writing the document

 

See also: AddPubKeyRecipient, CryptKeyLength, ActivateProtection, PDF Filter Support