Class EncryptionToolsRevision5_6


  • public class EncryptionToolsRevision5_6
    extends Object
    Author:
    Sergey Shemyakov
    • Constructor Detail

      • EncryptionToolsRevision5_6

        public EncryptionToolsRevision5_6()
    • Method Detail

      • getFileEncryptionKey

        public static byte[] getFileEncryptionKey​(byte[] password,
                                                  byte[] o,
                                                  byte[] u,
                                                  byte[] oe,
                                                  byte[] ue,
                                                  long revision)
                                           throws GeneralSecurityException
        Implementation of algorithm 2.A: Retrieving the file encryption key from an encrypted document in order to decrypt it (revision 6 and later) as described in PDF-2.0 specification.
        Parameters:
        password - is UTF-8 representation of password.
        o - is value of O key.
        u - is value of U key.
        oe - is value of OE key. At least one of oe, ue should not be null.
        ue - is value of UE key. At least one of oe, ue should not be null.
        Returns:
        calculated file encryption key.
        Throws:
        GeneralSecurityException - if password is not valid or error with AES-256 happens.