Class PubSecHandlerUsingAesGcm
java.lang.Object
com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
com.itextpdf.kernel.crypto.securityhandler.PubKeySecurityHandler
com.itextpdf.kernel.crypto.securityhandler.PubSecHandlerUsingAes128
com.itextpdf.kernel.crypto.securityhandler.PubSecHandlerUsingAes256
com.itextpdf.kernel.crypto.securityhandler.PubSecHandlerUsingAesGcm
Public-key security handler with Advanced Encryption Standard-Galois/Counter Mode (AES-GCM) encryption algorithm.
-
Field Summary
FieldsFields inherited from class SecurityHandler
extra, md5, mkey, nextObjectKey, nextObjectKeySize -
Constructor Summary
ConstructorsConstructorDescriptionPubSecHandlerUsingAesGcm(PdfDictionary encryptionDictionary, Certificate[] certs, int[] permissions, boolean encryptMetadata, boolean embeddedFilesOnly) Creates newPubSecHandlerUsingAesGcminstance for encryption.PubSecHandlerUsingAesGcm(PdfDictionary encryptionDictionary, Key certificateKey, Certificate certificate, String certificateKeyProvider, IExternalDecryptionProcess externalDecryptionProcess, boolean encryptMetadata) Creates newPubSecHandlerUsingAesGcminstance for decryption. -
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.protected voidsetPubSecSpecificHandlerDicEntries(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly) Methods inherited from class PubSecHandlerUsingAes256
getDigestAlgorithm, initKey, setEncryptionDictEntriesMethods inherited from class PubKeySecurityHandler
addAllRecipients, computeGlobalKey, computeGlobalKeyOnReading, createRecipientsArray, initKeyAndFillDictionary, initKeyAndReadDictionaryMethods inherited from class SecurityHandler
getMkey, getNextObjectKey
-
Field Details
-
noncePart
protected byte[] noncePart -
inObjectNonceCounter
protected int inObjectNonceCounter
-
-
Constructor Details
-
PubSecHandlerUsingAesGcm
public PubSecHandlerUsingAesGcm(PdfDictionary encryptionDictionary, Certificate[] certs, int[] permissions, boolean encryptMetadata, boolean embeddedFilesOnly) Creates newPubSecHandlerUsingAesGcminstance for encryption.- Parameters:
encryptionDictionary- document's encryption dictionarycerts- recipients' X.509 public key certificatespermissions- access permissions provided to each recipientencryptMetadata- indicates whether the document-level metadata stream shall be encryptedembeddedFilesOnly- indicates whether embedded files shall be encrypted in an otherwise unencrypted document
-
PubSecHandlerUsingAesGcm
public PubSecHandlerUsingAesGcm(PdfDictionary encryptionDictionary, Key certificateKey, Certificate certificate, String certificateKeyProvider, IExternalDecryptionProcess externalDecryptionProcess, boolean encryptMetadata) Creates newPubSecHandlerUsingAesGcminstance for decryption.- Parameters:
encryptionDictionary- document's encryption dictionarycertificateKey- the recipient privateKeyto the certificatecertificate- the recipientCertificate, serves as recipient identifiercertificateKeyProvider- the certificate key provider id forSecurity.getProvider(String)externalDecryptionProcess- the external decryption process to be usedencryptMetadata- indicates whether the document-level metadata stream shall be encrypted
-
-
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 classPubSecHandlerUsingAes256- Parameters:
objNumber- number of particular object for encryptionobjGeneration- generation of particular object for encryption
-
getEncryptionStream
Description copied from class:SecurityHandlerGets a stream wrapper, responsible for encryption.- Overrides:
getEncryptionStreamin classPubSecHandlerUsingAes128- Parameters:
os-OutputStreamto be wrapped- Returns:
OutputStreamEncryption, responsible for encryption.
-
getDecryptor
Description copied from class:SecurityHandlerGets decryptor object.- Overrides:
getDecryptorin classPubSecHandlerUsingAes128- Returns:
IDecryptor
-
setPubSecSpecificHandlerDicEntries
protected void setPubSecSpecificHandlerDicEntries(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly) - Overrides:
setPubSecSpecificHandlerDicEntriesin classPubSecHandlerUsingAes256
-
initMd5MessageDigest
protected void initMd5MessageDigest()Init md5 message digest.- Overrides:
initMd5MessageDigestin classPubSecHandlerUsingAes256
-