THotPDF.EnablePubKeyEncryption

THotPDF

 

เมธอด  ถัดไป  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);

 

คำอธิบาย

EnablePubKeyEncryption emit dictionary /Encrypt โดยใช้ /Filter /Adobe.PubSec HotPDF จัดการ symmetric file encryption และ key derivation ตาม PDF algorithm 9 ส่วน caller ส่ง random seed และ PKCS#7 envelopedData blob ที่สร้างจากภายนอกหนึ่งรายการต่อ recipient

 

ใช้ AddPubKeyRecipient หลัง method นี้สำหรับแต่ละ recipient ตั้ง ActivateProtection เป็น true ก่อนเขียนเอกสาร ค่า KeyType ที่รองรับคือ k40, k128 และ aes128; ยังไม่ได้ implement AES-256 public-key encryption

 

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