| java.lang.Object org.pdfbox.pdmodel.encryption.SecurityHandler
All known Subclasses: org.pdfbox.pdmodel.encryption.StandardSecurityHandler, org.pdfbox.pdmodel.encryption.PublicKeySecurityHandler,
SecurityHandler | abstract public class SecurityHandler (Code) | | This class represents a security handler as described in the PDF specifications.
A security handler is responsible of documents protection.
author: Ben Litchfield author: Benoit Guillon (benoit.guillon@snv.jussieu.fr) version: $Revision: 1.4 $ |
Field Summary | |
protected AccessPermission | currentAccessPermission The access permission granted to the current user for the document. | protected PDDocument | document The document whose security is handled by this security handler. | protected byte[] | encryptionKey The encryption key that will used to encrypt / decrypt. | protected int | keyLength The length of the secret key used to encrypt the document. | protected ARCFour | rc4 The RC4 implementation used for cryptographic functions. | protected int | version The value of V field of the Encryption dictionary. |
currentAccessPermission | protected AccessPermission currentAccessPermission(Code) | | The access permission granted to the current user for the document. These
permissions are computed during decryption and are in read only mode.
|
document | protected PDDocument document(Code) | | The document whose security is handled by this security handler.
|
encryptionKey | protected byte[] encryptionKey(Code) | | The encryption key that will used to encrypt / decrypt.
|
keyLength | protected int keyLength(Code) | | The length of the secret key used to encrypt the document.
|
rc4 | protected ARCFour rc4(Code) | | The RC4 implementation used for cryptographic functions.
|
version | protected int version(Code) | | The value of V field of the Encryption dictionary.
|
decryptStream | public void decryptStream(COSStream stream, long objNum, long genNum) throws CryptographyException, IOException(Code) | | This will decrypt a stream.
Parameters: stream - The stream to decrypt. Parameters: objNum - The object number. Parameters: genNum - The object generation number. throws: CryptographyException - If there is an error getting the stream. throws: IOException - If there is an error getting the stream data. |
decryptString | public void decryptString(COSString string, long objNum, long genNum) throws CryptographyException, IOException(Code) | | This will decrypt a string.
Parameters: string - the string to decrypt. Parameters: objNum - The object number. Parameters: genNum - The object generation number. throws: CryptographyException - If an error occurs during decryption. throws: IOException - If an error occurs writing the new string. |
encryptData | public void encryptData(long objectNumber, long genNumber, InputStream data, OutputStream output) throws CryptographyException, IOException(Code) | | Encrypt a set of data.
Parameters: objectNumber - The data object number. Parameters: genNumber - The data generation number. Parameters: data - The data to encrypt. Parameters: output - The output to write the encrypted data to. throws: CryptographyException - If there is an error during the encryption. throws: IOException - If there is an error reading the data. |
getCurrentAccessPermission | public AccessPermission getCurrentAccessPermission()(Code) | | Returns the access permissions that were computed during document decryption.
The returned object is in read only mode.
the access permissions or null if the document was not decrypted. |
getKeyLength | public int getKeyLength()(Code) | | Getter of the property keyLength.
Returns the keyLength. |
setKeyLength | public void setKeyLength(int keyLen)(Code) | | Setter of the property keyLength.
Parameters: keyLen - The keyLength to set. |
|
|