Class SecurityHandler
java.lang.Object
com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
- Direct Known Subclasses:
PubKeySecurityHandler
,StandardSecurityHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]
Work area to prepare the object/generation bytesprivate static final IBouncyCastleFactory
private static final org.slf4j.Logger
protected MessageDigest
protected byte[]
The global encryption keyprotected byte[]
The encryption key for a particular object/generation.protected int
The encryption key length for a particular object/generation It is recalculated withsetHashKeyForNextObject(int, int)
for every object individually based in its object/generation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract IDecryptor
abstract OutputStreamEncryption
private void
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.
-
Field Details
-
FACTORY
-
LOGGER
private static final org.slf4j.Logger LOGGER -
mkey
protected byte[] mkeyThe global encryption key -
nextObjectKey
protected byte[] nextObjectKeyThe encryption key for a particular object/generation. It is recalculated withsetHashKeyForNextObject(int, int)
for every object individually based in its object/generation. -
nextObjectKeySize
protected int nextObjectKeySizeThe encryption key length for a particular object/generation It is recalculated withsetHashKeyForNextObject(int, int)
for every object individually based in its object/generation. -
md5
-
extra
protected byte[] extraWork area to prepare the object/generation bytes
-
-
Constructor Details
-
SecurityHandler
protected SecurityHandler()
-
-
Method Details
-
setHashKeyForNextObject
public 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.- Parameters:
objNumber
- number of particular object for encryptionobjGeneration
- generation of particular object for encryption
-
getEncryptionStream
-
getDecryptor
-
safeInitMessageDigest
private void safeInitMessageDigest()
-