|
THotPDF.CryptKeyLength
|
Вверх Назад Далее |
|
Determines PDF file encryption method.
type THPDFKeyType = ( k40, k128, aes128, aes256 );
Delphi syntax: property CryptKeyLength: THPDFKeyType;
C++ syntax: __property THPDFKeyType CryptKeyLength;
Описание Используйте CryptKeyLength, чтобы выбрать standard security handler revision и cipher при включенном ActivateProtection
Value Meaning k40 Standard security handler V=1, R=2, RC4 with a 40-bit key (PDF 1.1+). k128 Standard security handler V=2, R=3, RC4 with a 128-bit key (PDF 1.4+). aes128 Standard security handler V=4, R=4 with crypt filter aes256 Standard security handler V=5 with crypt filter
Public-Key Security Handler (PDF 1.7 7.6.5): THotPDF.EnablePubKeyEncryption(seed, KeyType, EncryptMetadata) + THotPDF.AddPubKeyRecipient(envelope) выводят encrypt dictionary /Filter /Adobe.PubSec. Caller предоставляет 20-byte random seed и один PKCS#7 envelopedData binary blob на каждого recipient, построенный внешне через Windows CryptoAPI, OpenSSL или pycryptodome. HotPDF выводит file encryption key по algorithm 9 и повторно использует стандартную per-object key derivation для AES-128 / RC4 streams. Доступно начиная с HotPDF v2.33.0 Для certificate-based encryption с одним документом и несколькими recipients вызовите EnablePubKeyEncryption(seed, KeyType, EncryptMetadata) вместо установки UserPassword / OwnerPassword. Те же значения CryptKeyLength применяются к symmetric cipher; caller должен построить один PKCS#7 envelopedData blob на каждого recipient и добавить его через AddPubKeyRecipient
Code Example
См. также: ActivateProtection, OwnerPassword, ProtectOptions, UserPassword
|