Home » pdfbox-1.1.0-src » org.apache.pdfbox.pdmodel.encryption » [javadoc | source]
org.apache.pdfbox.pdmodel.encryption
abstract public class: SecurityHandler [javadoc | source]
java.lang.Object
   org.apache.pdfbox.pdmodel.encryption.SecurityHandler

Direct Known Subclasses:
    StandardSecurityHandler, PublicKeySecurityHandler

This class represents a security handler as described in the PDF specifications. A security handler is responsible of documents protection.
Field Summary
protected  int version    The value of V field of the Encryption dictionary. 
protected  int keyLength    The length of the secret key used to encrypt the document. 
protected  byte[] encryptionKey    The encryption key that will used to encrypt / decrypt. 
protected  PDDocument document    The document whose security is handled by this security handler. 
protected  ARCFour rc4    The RC4 implementation used for cryptographic functions. 
protected  AccessPermission currentAccessPermission    The access permission granted to the current user for the document. These permissions are computed during decryption and are in read only mode. 
Method from org.apache.pdfbox.pdmodel.encryption.SecurityHandler Summary:
decryptDocument,   decryptStream,   decryptString,   encryptData,   getCurrentAccessPermission,   getKeyLength,   prepareDocumentForEncryption,   proceedDecryption,   setKeyLength
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.pdfbox.pdmodel.encryption.SecurityHandler Detail:
 abstract public  void decryptDocument(PDDocument doc,
    DecryptionMaterial mat) throws CryptographyException, IOException
    Prepare the document for decryption.
 public  void decryptStream(COSStream stream,
    long objNum,
    long genNum) throws CryptographyException, IOException 
    This will decrypt a stream.
 public  void decryptString(COSString string,
    long objNum,
    long genNum) throws CryptographyException, IOException 
    This will decrypt a string.
 public  void encryptData(long objectNumber,
    long genNumber,
    InputStream data,
    OutputStream output) throws CryptographyException, IOException 
    Encrypt a set of data.
 public AccessPermission getCurrentAccessPermission() 
    Returns the access permissions that were computed during document decryption. The returned object is in read only mode.
 public int getKeyLength() 
    Getter of the property keyLength.
 abstract public  void prepareDocumentForEncryption(PDDocument doc) throws CryptographyException, IOException
    Prepare the document for encryption.
 protected  void proceedDecryption() throws IOException, CryptographyException 
    This method must be called by an implementation of this class to really proceed to decryption.
 public  void setKeyLength(int keyLen) 
    Setter of the property keyLength.