Class StandardHandlerUsingStandard40
java.lang.Object
com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardHandlerUsingStandard40
- Direct Known Subclasses:
-
StandardHandlerUsingStandard128
-
Field Summary
Modifier and TypeFieldDescriptionprotected ARCFOUREncryption
protected byte[]
protected int
protected static final byte[]
protected static final byte[]
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
ConstructorDescriptionStandardHandlerUsingStandard40
(PdfDictionary encryptionDictionary, byte[] password, byte[] documentId, boolean encryptMetadata) StandardHandlerUsingStandard40
(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly, byte[] documentId) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
calculatePermissions
(int permissions) protected void
computeGlobalEncryptionKey
(byte[] userPad, byte[] ownerKey, boolean encryptMetadata) protected byte[]
computeOwnerKey
(byte[] userPad, byte[] ownerPad) protected byte[]
byte[]
computeUserPassword
(byte[] ownerPassword, PdfDictionary encryptionDictionary) Gets decryptor object.Gets a stream wrapper, responsible for encryption.protected boolean
isValidPassword
(byte[] uValue, byte[] userKey) protected void
setSpecificHandlerDicEntries
(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly) Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
equalsArray, generateOwnerPasswordIfNullOrEmpty, getIsoBytes, getPermissions, isUsedOwnerPassword, setPermissions, setStandardHandlerDicEntries
Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
getMkey, getNextObjectKey, setHashKeyForNextObject
-
Field Details
-
pad
protected static final byte[] pad -
metadataPad
protected static final byte[] metadataPad -
documentId
protected byte[] documentId -
keyLength
protected int keyLength -
arcfour
-
-
Constructor Details
-
StandardHandlerUsingStandard40
public StandardHandlerUsingStandard40(PdfDictionary encryptionDictionary, byte[] userPassword, byte[] ownerPassword, int permissions, boolean encryptMetadata, boolean embeddedFilesOnly, byte[] documentId) -
StandardHandlerUsingStandard40
public StandardHandlerUsingStandard40(PdfDictionary encryptionDictionary, byte[] password, byte[] documentId, boolean encryptMetadata)
-
-
Method Details
-
getEncryptionStream
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
Description copied from class:SecurityHandler
Gets decryptor object.- Specified by:
-
getDecryptor
in classSecurityHandler
- Returns:
-
IDecryptor
-
computeUserPassword
-
calculatePermissions
protected void calculatePermissions(int permissions) -
computeOwnerKey
protected byte[] computeOwnerKey(byte[] userPad, byte[] ownerPad) -
computeGlobalEncryptionKey
protected void computeGlobalEncryptionKey(byte[] userPad, byte[] ownerKey, boolean encryptMetadata) -
computeUserKey
protected byte[] computeUserKey() -
setSpecificHandlerDicEntries
protected void setSpecificHandlerDicEntries(PdfDictionary encryptionDictionary, boolean encryptMetadata, boolean embeddedFilesOnly) -
isValidPassword
protected boolean isValidPassword(byte[] uValue, byte[] userKey)
-