Class PubSecHandlerUsingAes128
- java.lang.Object
-
- com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
-
- com.itextpdf.kernel.crypto.securityhandler.PubKeySecurityHandler
-
- com.itextpdf.kernel.crypto.securityhandler.PubSecHandlerUsingAes128
-
- Direct Known Subclasses:
PubSecHandlerUsingAes256
public class PubSecHandlerUsingAes128 extends PubKeySecurityHandler
-
-
Field Summary
Fields Modifier and Type Field Description private static byte[]
salt
-
Fields inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
extra, md5, mkey, nextObjectKey, nextObjectKeySize
-
-
Constructor Summary
Constructors Constructor Description PubSecHandlerUsingAes128(PdfDictionary encryptionDictionary, java.security.cert.Certificate[] certs, int[] permissions, boolean encryptMetadata, boolean embeddedFilesOnly)
PubSecHandlerUsingAes128(PdfDictionary encryptionDictionary, java.security.Key certificateKey, java.security.cert.Certificate certificate, java.lang.String certificateKeyProvider, IExternalDecryptionProcess externalDecryptionProcess, boolean encryptMetadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IDecryptor
getDecryptor()
Gets decryptor object.protected java.lang.String
getDigestAlgorithm()
OutputStreamEncryption
getEncryptionStream(java.io.OutputStream os)
Gets a stream wrapper, responsible for encryption.protected void
initKey(byte[] globalKey, int keyLength)
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.protected void
setPubSecSpecificHandlerDicEntries(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly)
-
Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.PubKeySecurityHandler
addAllRecipients, computeGlobalKey, computeGlobalKeyOnReading, createRecipientsArray, initKeyAndFillDictionary, initKeyAndReadDictionary
-
Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
getMkey, getNextObjectKey
-
-
-
-
Constructor Detail
-
PubSecHandlerUsingAes128
public PubSecHandlerUsingAes128(PdfDictionary encryptionDictionary, java.security.cert.Certificate[] certs, int[] permissions, boolean encryptMetadata, boolean embeddedFilesOnly)
-
PubSecHandlerUsingAes128
public PubSecHandlerUsingAes128(PdfDictionary encryptionDictionary, java.security.Key certificateKey, java.security.cert.Certificate certificate, java.lang.String certificateKeyProvider, IExternalDecryptionProcess externalDecryptionProcess, boolean encryptMetadata)
-
-
Method Detail
-
getEncryptionStream
public OutputStreamEncryption getEncryptionStream(java.io.OutputStream os)
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
public IDecryptor getDecryptor()
Description copied from class:SecurityHandler
Gets decryptor object.- Specified by:
getDecryptor
in classSecurityHandler
- Returns:
IDecryptor
-
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 encryptionobjGeneration
- generation of particular object for encryption
-
getDigestAlgorithm
protected java.lang.String getDigestAlgorithm()
- Specified by:
getDigestAlgorithm
in classPubKeySecurityHandler
-
initKey
protected void initKey(byte[] globalKey, int keyLength)
- Specified by:
initKey
in classPubKeySecurityHandler
-
setPubSecSpecificHandlerDicEntries
protected void setPubSecSpecificHandlerDicEntries(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly)
- Specified by:
setPubSecSpecificHandlerDicEntries
in classPubKeySecurityHandler
-
-