|
Encrypt the document using X.509 certificate First load the document as described in the corresponding how-to article. Ensure, that the document is not already encrypted by checking the value of Encrypted property of TElPDFDocument class. Next, create an instance of TElPDFPublicKeySecurityHandler class and assign the reference to the created instance to EncryptionHandler property of TElPDFDocument class. To specify certificates, used for encryption, take the following steps:
Also you need to set encryption parameters using StreamEncryptionAlgorithm, StreamEncryptionKeyBits, StringEncryptionAlgorithm, StringEncryptionKeyBits properties of TElPDFSecurityHandler class. First two properties specify encryption parameters for binary data, while the last one specify parameters for string encryption. You can specify whether metadata should be encrypted by setting the appropriate value to EncryptMetadata property of TElPDFSecurityHandler class. Call Encrypt() method of TElPDFDocument to perform encryption. Save and close the document using Close() method. |

