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 and derives the file-encryption key from the exact 20-byte random seed plus the ordered recipient envelopes

 

Use 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, PDF Filter Support