HotPDF Developer Reference
Delphi and C++Builder PDF component help
|
THotPDF.EnablePubKeyEncryption
|
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.
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.
See also: AddPubKeyRecipient, CryptKeyLength, ActivateProtection, PDF Filter Support |