Class DocumentEncryption


  • public class DocumentEncryption
    extends java.lang.Object
    Deprecated.
    use the new security API instead.
    This class will deal with encrypting/decrypting a document.
    Version:
    $Revision: 1.13 $
    Author:
    Ben Litchfield
    See Also:
    StandardSecurityHandler
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void decrypt​(java.lang.Object obj, long objNum, long genNum)
      Deprecated.
      This will dispatch to the correct method.
      void decryptDocument​(java.lang.String password)
      Deprecated.
      This will decrypt the document.
      void initForEncryption()
      Deprecated.
      This will encrypt the given document, given the owner password and user password.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DocumentEncryption

        public DocumentEncryption​(PDDocument doc)
        Deprecated.
        Constructor.
        Parameters:
        doc - The document to decrypt.
      • DocumentEncryption

        public DocumentEncryption​(COSDocument doc)
        Deprecated.
        Constructor.
        Parameters:
        doc - The document to decrypt.
    • Method Detail

      • initForEncryption

        public void initForEncryption()
                               throws CryptographyException,
                                      java.io.IOException
        Deprecated.
        This will encrypt the given document, given the owner password and user password. The encryption method used is the standard filter.
        Throws:
        CryptographyException - If an error occurs during encryption.
        java.io.IOException - If there is an error accessing the data.
      • decryptDocument

        public void decryptDocument​(java.lang.String password)
                             throws CryptographyException,
                                    java.io.IOException,
                                    InvalidPasswordException
        Deprecated.
        This will decrypt the document.
        Parameters:
        password - The password for the document.
        Throws:
        CryptographyException - If there is an error decrypting the document.
        java.io.IOException - If there is an error getting the stream data.
        InvalidPasswordException - If the password is not a user or owner password.
      • decrypt

        public void decrypt​(java.lang.Object obj,
                            long objNum,
                            long genNum)
                     throws CryptographyException,
                            java.io.IOException
        Deprecated.
        This will dispatch to the correct method.
        Parameters:
        obj - The object to decrypt.
        objNum - The object number.
        genNum - The object generation Number.
        Throws:
        CryptographyException - If there is an error decrypting the stream.
        java.io.IOException - If there is an error getting the stream data.