Class StandardSecurityHandler
java.lang.Object
com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
- Direct Known Subclasses:
-
StandardHandlerUsingAes256
,StandardHandlerUsingStandard40
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected static final int
protected static final int
protected static final int
protected boolean
Fields inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
extra, md5, mkey, nextObjectKey, nextObjectKeySize
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static boolean
equalsArray
(byte[] ar1, byte[] ar2, int size) protected byte[]
generateOwnerPasswordIfNullOrEmpty
(byte[] ownerPassword) protected byte[]
getIsoBytes
(PdfString string) Gets bytes of String-value without considering encoding.int
boolean
void
setPermissions
(int permissions, PdfDictionary encryptionDictionary) Updates encryption dictionary with the security permissions provided.protected void
setStandardHandlerDicEntries
(PdfDictionary encryptionDictionary, byte[] userKey, byte[] ownerKey) Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
getDecryptor, getEncryptionStream, getMkey, getNextObjectKey, setHashKeyForNextObject
-
Field Details
-
PERMS_MASK_1_FOR_REVISION_2
protected static final int PERMS_MASK_1_FOR_REVISION_2- See Also:
-
PERMS_MASK_1_FOR_REVISION_3_OR_GREATER
protected static final int PERMS_MASK_1_FOR_REVISION_3_OR_GREATER- See Also:
-
PERMS_MASK_2
protected static final int PERMS_MASK_2- See Also:
-
permissions
protected int permissions -
usedOwnerPassword
protected boolean usedOwnerPassword
-
-
Constructor Details
-
StandardSecurityHandler
public StandardSecurityHandler()
-
-
Method Details
-
getPermissions
public int getPermissions() -
setPermissions
Updates encryption dictionary with the security permissions provided.- Parameters:
-
permissions
- new permissions to set -
encryptionDictionary
- encryption dictionary to update
-
isUsedOwnerPassword
public boolean isUsedOwnerPassword() -
setStandardHandlerDicEntries
protected void setStandardHandlerDicEntries(PdfDictionary encryptionDictionary, byte[] userKey, byte[] ownerKey) -
generateOwnerPasswordIfNullOrEmpty
protected byte[] generateOwnerPasswordIfNullOrEmpty(byte[] ownerPassword) -
getIsoBytes
Gets bytes of String-value without considering encoding.- Parameters:
-
string
- aPdfString
to get bytes from it - Returns:
- byte array
-
equalsArray
protected static boolean equalsArray(byte[] ar1, byte[] ar2, int size)
-