Class StandardHandlerUsingAesGcm
java.lang.Object
com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingAes256
com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingAesGcm
Standard security handler with Advanced Encryption Standard-Galois/Counter Mode (AES-GCM) encryption algorithm.
-
Field Summary
Fields inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingAes256
encryptMetadata
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
ConstructorDescriptionStandardHandlerUsingAesGcm
(PdfDictionary encryptionDictionary, byte[] password) Creates newStandardHandlerUsingAesGcm
instance for decryption.StandardHandlerUsingAesGcm
(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly) Creates newStandardHandlerUsingAesGcm
instance for encryption. -
Method Summary
Modifier and TypeMethodDescriptionGets decryptor object.Gets a stream wrapper, responsible for encryption.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.Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingAes256
isEncryptMetadata, setPermissions
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
-
noncePart
protected byte[] noncePart -
inObjectNonceCounter
protected int inObjectNonceCounter
-
-
Constructor Details
-
StandardHandlerUsingAesGcm
public StandardHandlerUsingAesGcm(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly) Creates newStandardHandlerUsingAesGcm
instance for encryption.- Parameters:
-
encryptionDictionary
- document's encryption dictionary -
userPassword
- user password -
ownerPassword
- owner password -
permissions
- access permissions -
encryptMetadata
- indicates whether the document-level metadata stream shall be encrypted -
embeddedFilesOnly
- indicates whether embedded files shall be encrypted in an otherwise unencrypted document
-
StandardHandlerUsingAesGcm
Creates newStandardHandlerUsingAesGcm
instance for decryption.- Parameters:
-
encryptionDictionary
- document's encryption dictionary -
password
- owner or user password to decrypt the document
-
-
Method Details
-
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 classStandardHandlerUsingAes256
- 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.- Overrides:
-
getEncryptionStream
in classStandardHandlerUsingAes256
- Parameters:
-
os
-OutputStream
to be wrapped - Returns:
-
OutputStreamEncryption
, responsible for encryption.
-
getDecryptor
Description copied from class:SecurityHandler
Gets decryptor object.- Overrides:
-
getDecryptor
in classStandardHandlerUsingAes256
- Returns:
-
IDecryptor
-