public class EncryptionProperties extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
encryptionAlgorithm |
protected byte[] |
ownerPassword |
protected Certificate[] |
publicCertificates
PublicKeyEncryption properties
|
protected int[] |
publicKeyEncryptPermissions |
protected int |
standardEncryptPermissions |
protected byte[] |
userPassword
StandardEncryption properties
|
Constructor and Description |
---|
EncryptionProperties() |
Modifier and Type | Method and Description |
---|---|
EncryptionProperties |
setPublicKeyEncryption(Certificate[] certs, int[] permissions, int encryptionAlgorithm)
Sets the certificate encryption options for the document.
|
EncryptionProperties |
setStandardEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionAlgorithm)
Sets the encryption options for the document.
|
protected int encryptionAlgorithm
protected byte[] userPassword
protected byte[] ownerPassword
protected int standardEncryptPermissions
protected Certificate[] publicCertificates
protected int[] publicKeyEncryptPermissions
public EncryptionProperties setStandardEncryption(byte[] userPassword, byte[] ownerPassword, int permissions, int encryptionAlgorithm)
EncryptionConstants
.
userPassword
- the user password. Can be null or empty
ownerPassword
- the owner password. Can be null or empty
permissions
- the user permissions
encryptionAlgorithm
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, ENCRYPTION_AES128 or ENCRYPTION_AES256 Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext
public EncryptionProperties setPublicKeyEncryption(Certificate[] certs, int[] permissions, int encryptionAlgorithm)
EncryptionConstants
.
certs
- the public certificates to be used for the encryption
permissions
- the user permissions for each of the certificates
encryptionAlgorithm
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128, ENCRYPTION_AES128 or ENCRYPTION_AES256.
Copyright © 1998–2018 iText Group NV. All rights reserved.