Class StandardHandlerUsingAes256
java.lang.Object
com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingAes256
- Direct Known Subclasses:
-
StandardHandlerUsingAesGcm
-
Field Summary
Fields inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
permissions, PERMS_MASK_1_FOR_REVISION_2, PERMS_MASK_1_FOR_REVISION_3_OR_GREATER, PERMS_MASK_2, usedOwnerPassword
Fields inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
extra, md5, mkey, nextObjectKey, nextObjectKeySize
-
Constructor Summary
ConstructorDescriptionStandardHandlerUsingAes256
(PdfDictionary encryptionDictionary, byte[] password) StandardHandlerUsingAes256
(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly, PdfVersion version) -
Method Summary
Modifier and TypeMethodDescriptionGets decryptor object.Gets a stream wrapper, responsible for encryption.boolean
Checks whether the document-level metadata stream will be encrypted.void
setHashKeyForNextObject
(int objNumber, int objGeneration) Note: For most of the supported security handlers algorithm to calculate encryption key for particular object is the same.void
setPermissions
(int permissions, PdfDictionary encryptionDictionary) Updates encryption dictionary with the security permissions provided.Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
equalsArray, generateOwnerPasswordIfNullOrEmpty, getIsoBytes, getPermissions, isUsedOwnerPassword, setStandardHandlerDicEntries
Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
getMkey, getNextObjectKey
-
Field Details
-
encryptMetadata
protected boolean encryptMetadata
-
-
Constructor Details
-
StandardHandlerUsingAes256
public StandardHandlerUsingAes256(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly, PdfVersion version) -
StandardHandlerUsingAes256
-
-
Method Details
-
isEncryptMetadata
public boolean isEncryptMetadata()Checks whether the document-level metadata stream will be encrypted.- Returns:
-
true
if the document-level metadata stream shall be encrypted,false
otherwise
-
setHashKeyForNextObject
public void setHashKeyForNextObject(int objNumber, int objGeneration) Description copied from class:SecurityHandler
Note: For most of the supported security handlers algorithm to calculate encryption key for particular object is the same.- Overrides:
-
setHashKeyForNextObject
in classSecurityHandler
- Parameters:
-
objNumber
- number of particular object for encryption -
objGeneration
- generation of particular object for encryption
-
getEncryptionStream
Description copied from class:SecurityHandler
Gets a stream wrapper, responsible for encryption.- Specified by:
-
getEncryptionStream
in classSecurityHandler
- Parameters:
-
os
-OutputStream
to be wrapped - Returns:
-
OutputStreamEncryption
, responsible for encryption.
-
getDecryptor
Description copied from class:SecurityHandler
Gets decryptor object.- Specified by:
-
getDecryptor
in classSecurityHandler
- Returns:
-
IDecryptor
-
setPermissions
Updates encryption dictionary with the security permissions provided.- Overrides:
-
setPermissions
in classStandardSecurityHandler
- Parameters:
-
permissions
- new permissions to set -
encryptionDictionary
- encryption dictionary to update
-