Uses of Class
org.apache.pdfbox.exceptions.CryptographyException

Packages that use CryptographyException
Package
Description
These classes deal with encryption algorithms that are used in the PDF Document.
The PDModel package represents a high level API for creating and manipulating PDF documents.
The encryption package will handle the PDF document security handlers and the functionality of pluggable security handlers.
  • Uses of CryptographyException in org.apache.pdfbox.encryption

    Modifier and Type
    Method
    Description
    final byte[]
    PDFEncryption.computeEncryptedKey(byte[] password, byte[] o, int permissions, byte[] id, int revision, int length)
    Deprecated.
    This will compute the encrypted key.
    final byte[]
    PDFEncryption.computeOwnerPassword(byte[] ownerPassword, byte[] userPassword, int revision, int length)
    Deprecated.
    This algorithm is taked from PDF Reference 1.4 Algorithm 3.3 Page 79.
    final byte[]
    PDFEncryption.computeUserPassword(byte[] password, byte[] o, int permissions, byte[] id, int revision, int length)
    Deprecated.
    This will compute the user password hash.
    void
    DocumentEncryption.decrypt(Object obj, long objNum, long genNum)
    Deprecated.
    This will dispatch to the correct method.
    void
    DocumentEncryption.decryptDocument(String password)
    Deprecated.
    This will decrypt the document.
    final void
    PDFEncryption.encryptData(long objectNumber, long genNumber, byte[] key, InputStream data, OutputStream output)
    Deprecated.
    This will encrypt a piece of data.
    final byte[]
    PDFEncryption.getUserPassword(byte[] ownerPassword, byte[] o, int revision, long length)
    Deprecated.
    This will get the user password from the owner password and the documents o value.
    void
    DocumentEncryption.initForEncryption()
    Deprecated.
    This will encrypt the given document, given the owner password and user password.
    final boolean
    PDFEncryption.isOwnerPassword(byte[] ownerPassword, byte[] u, byte[] o, int permissions, byte[] id, int revision, int length)
    Deprecated.
    This will tell if this is the owner password or not.
    final boolean
    PDFEncryption.isUserPassword(byte[] password, byte[] u, byte[] o, int permissions, byte[] id, int revision, int length)
    Deprecated.
    This will tell if this is a valid user password.
  • Uses of CryptographyException in org.apache.pdfbox.pdmodel

    Modifier and Type
    Method
    Description
    void
    PDDocument.decrypt(String password)
    This will decrypt a document.
    void
    PDDocument.encrypt(String ownerPassword, String userPassword)
    This will mark a document to be encrypted.
    boolean
    PDDocument.isOwnerPassword(String password)
    Deprecated. 
    boolean
    PDDocument.isUserPassword(String password)
    Deprecated. 
    void
    Tries to decrypt the document in memory using the provided decryption material.
  • Uses of CryptographyException in org.apache.pdfbox.pdmodel.encryption

    Modifier and Type
    Method
    Description
    final byte[]
    StandardSecurityHandler.computeEncryptedKey(byte[] password, byte[] o, int permissions, byte[] id, int encRevision, int length, boolean encryptMetadata)
    Compute the encryption key.
    final byte[]
    StandardSecurityHandler.computeOwnerPassword(byte[] ownerPassword, byte[] userPassword, int encRevision, int length)
    Compute the owner entry in the encryption dictionary.
    final byte[]
    StandardSecurityHandler.computeUserPassword(byte[] password, byte[] o, int permissions, byte[] id, int encRevision, int length, boolean encryptMetadata)
    This will compute the user password hash.
    void
    SecurityHandler.decryptArray(COSArray array, long objNum, long genNum)
    This will decrypt an array.
    void
    PublicKeySecurityHandler.decryptDocument(PDDocument doc, DecryptionMaterial decryptionMaterial)
    Decrypt the document.
    abstract void
    SecurityHandler.decryptDocument(PDDocument doc, DecryptionMaterial mat)
    Prepare the document for decryption.
    void
    StandardSecurityHandler.decryptDocument(PDDocument doc, DecryptionMaterial decryptionMaterial)
    Decrypt the document.
    void
    SecurityHandler.decryptStream(COSStream stream, long objNum, long genNum)
    This will decrypt a stream.
    void
    SecurityHandler.decryptString(COSString string, long objNum, long genNum)
    This will decrypt a string.
    void
    SecurityHandler.encryptData(long objectNumber, long genNumber, InputStream data, OutputStream output)
    Deprecated.
    While this works fine for RC4 encryption, it will never decrypt AES data You should use encryptData(objectNumber, genNumber, data, output, decrypt) which can do everything.
    void
    SecurityHandler.encryptData(long objectNumber, long genNumber, InputStream data, OutputStream output, boolean decrypt)
    Encrypt a set of data.
    void
    SecurityHandler.encryptStream(COSStream stream, long objNum, long genNum)
    This will encrypt a stream, but not the dictionary as the dictionary is encrypted by visitFromString() in COSWriter and we don't want to encrypt it twice.
    void
    SecurityHandler.encryptString(COSString string, long objNum, long genNum)
    This will encrypt a string.
    final byte[]
    StandardSecurityHandler.getUserPassword(byte[] ownerPassword, byte[] o, int encRevision, int length)
    Get the user password based on the owner password.
    final boolean
    StandardSecurityHandler.isOwnerPassword(byte[] ownerPassword, byte[] u, byte[] o, int permissions, byte[] id, int encRevision, int length, boolean encryptMetadata)
    Check for owner password.
    final boolean
    StandardSecurityHandler.isOwnerPassword(String password, byte[] u, byte[] o, int permissions, byte[] id, int encRevision, int length, boolean encryptMetadata)
    Check for owner password.
    final boolean
    StandardSecurityHandler.isUserPassword(byte[] password, byte[] u, byte[] o, int permissions, byte[] id, int encRevision, int length, boolean encryptMetadata)
    Check if a plaintext password is the user password.
    final boolean
    StandardSecurityHandler.isUserPassword(String password, byte[] u, byte[] o, int permissions, byte[] id, int encRevision, int length, boolean encryptMetadata)
    Check if a plaintext password is the user password.
    void
    PublicKeySecurityHandler.prepareDocumentForEncryption(PDDocument doc)
    Prepare the document for encryption.
    abstract void
    Prepare the document for encryption.
    void
    StandardSecurityHandler.prepareDocumentForEncryption(PDDocument doc)
    Prepare document for encryption.
    void
    PublicKeySecurityHandler.prepareForDecryption(PDEncryptionDictionary encDictionary, COSArray documentIDArray, DecryptionMaterial decryptionMaterial)
    Prepares everything to decrypt the document.
    abstract void
    SecurityHandler.prepareForDecryption(PDEncryptionDictionary encDictionary, COSArray documentIDArray, DecryptionMaterial decryptionMaterial)
    Prepares everything to decrypt the document.
    void
    StandardSecurityHandler.prepareForDecryption(PDEncryptionDictionary encDictionary, COSArray documentIDArray, DecryptionMaterial decryptionMaterial)
    Prepares everything to decrypt the document.
    protected void
    SecurityHandler.proceedDecryption()
    This method must be called by an implementation of this class to really proceed to decryption.