Class StandardSecurityHandler
- java.lang.Object
-
- com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
-
- com.itextpdf.kernel.crypto.securityhandler.StandardSecurityHandler
-
- Direct Known Subclasses:
StandardHandlerUsingAes256,StandardHandlerUsingStandard40
public abstract class StandardSecurityHandler extends SecurityHandler
-
-
Field Summary
Fields Modifier and Type Field Description protected intpermissionsprotected static intPERMS_MASK_1_FOR_REVISION_2protected static intPERMS_MASK_1_FOR_REVISION_3_OR_GREATERprotected static intPERMS_MASK_2protected booleanusedOwnerPassword-
Fields inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
extra, md5, mkey, nextObjectKey, nextObjectKeySize
-
-
Constructor Summary
Constructors Constructor Description StandardSecurityHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static booleanequalsArray(byte[] ar1, byte[] ar2, int size)protected byte[]generateOwnerPasswordIfNullOrEmpty(byte[] ownerPassword)protected byte[]getIsoBytes(PdfString string)Gets bytes of String-value without considering encoding.intgetPermissions()booleanisUsedOwnerPassword()voidsetPermissions(int permissions, PdfDictionary encryptionDictionary)Updates encryption dictionary with the security permissions provided.protected voidsetStandardHandlerDicEntries(PdfDictionary encryptionDictionary, byte[] userKey, byte[] ownerKey)-
Methods inherited from class com.itextpdf.kernel.crypto.securityhandler.SecurityHandler
getDecryptor, getEncryptionStream, getMkey, getNextObjectKey, initMd5MessageDigest, setHashKeyForNextObject
-
-
-
-
Field Detail
-
PERMS_MASK_1_FOR_REVISION_2
protected static final int PERMS_MASK_1_FOR_REVISION_2
- See Also:
- Constant Field Values
-
PERMS_MASK_1_FOR_REVISION_3_OR_GREATER
protected static final int PERMS_MASK_1_FOR_REVISION_3_OR_GREATER
- See Also:
- Constant Field Values
-
PERMS_MASK_2
protected static final int PERMS_MASK_2
- See Also:
- Constant Field Values
-
permissions
protected int permissions
-
usedOwnerPassword
protected boolean usedOwnerPassword
-
-
Method Detail
-
getPermissions
public int getPermissions()
-
setPermissions
public void setPermissions(int permissions, PdfDictionary encryptionDictionary)Updates encryption dictionary with the security permissions provided.- Parameters:
permissions- new permissions to setencryptionDictionary- 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
protected byte[] getIsoBytes(PdfString string)
Gets bytes of String-value without considering encoding.- Parameters:
string- aPdfStringto get bytes from it- Returns:
- byte array
-
equalsArray
protected static boolean equalsArray(byte[] ar1, byte[] ar2, int size)
-
-