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
FieldsFields inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingAes256
encryptMetadataFields 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, usedOwnerPasswordFields inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
extra, md5, mkey, nextObjectKey, nextObjectKeySize -
Constructor Summary
ConstructorsConstructorDescriptionStandardHandlerUsingAesGcm(PdfDictionary encryptionDictionary, byte[] password) Creates newStandardHandlerUsingAesGcminstance for decryption.StandardHandlerUsingAesGcm(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly) Creates newStandardHandlerUsingAesGcminstance for encryption. -
Method Summary
Modifier and TypeMethodDescriptionGets decryptor object.Gets a stream wrapper, responsible for encryption.protected voidInit md5 message digest.voidsetHashKeyForNextObject(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, setPermissionsMethods inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
equalsArray, generateOwnerPasswordIfNullOrEmpty, getIsoBytes, getPermissions, isUsedOwnerPassword, setStandardHandlerDicEntriesMethods 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 newStandardHandlerUsingAesGcminstance 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 newStandardHandlerUsingAesGcminstance 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:SecurityHandlerNote: For most of the supported security handlers algorithm to calculate encryption key for particular object is the same.- Overrides:
-
setHashKeyForNextObjectin classStandardHandlerUsingAes256 - Parameters:
-
objNumber- number of particular object for encryption -
objGeneration- generation of particular object for encryption
-
getEncryptionStream
Description copied from class:SecurityHandlerGets a stream wrapper, responsible for encryption.- Overrides:
-
getEncryptionStreamin classStandardHandlerUsingAes256 - Parameters:
-
os-OutputStreamto be wrapped - Returns:
-
OutputStreamEncryption, responsible for encryption.
-
getDecryptor
Description copied from class:SecurityHandlerGets decryptor object.- Overrides:
-
getDecryptorin classStandardHandlerUsingAes256 - Returns:
-
IDecryptor
-
initMd5MessageDigest
protected void initMd5MessageDigest()Init md5 message digest.- Overrides:
-
initMd5MessageDigestin classStandardHandlerUsingAes256
-