Class COSFilterRC4DecryptionDefault

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class COSFilterRC4DecryptionDefault
    extends ASBufferedInFilter
    Filter that decrypts data using RC4 cipher decryption according to Algorithm 1 of 7.6.2 of ISO 32000:2008.
    Author:
    Sergey Shemyakov
    • Constructor Detail

      • COSFilterRC4DecryptionDefault

        public COSFilterRC4DecryptionDefault​(ASInputStream stream,
                                             COSKey objectKey,
                                             byte[] encryptionKey)
                                      throws IOException,
                                             NoSuchAlgorithmException
        Constructor.
        Parameters:
        stream - is stream with encrypted data.
        objectKey - contains object and generation numbers from object identifier for object that is being decrypted. If it is direct object, objectKey is taken from indirect object that contains it.
        encryptionKey - is encryption key that is calculated from user password and encryption dictionary.
        Throws:
        IOException
        NoSuchAlgorithmException
    • Method Detail

      • getObjectKeyDigest

        public static byte[] getObjectKeyDigest​(COSKey objectKey)
        Gets a byte string consisting of object number and object generation concatenated.
        Parameters:
        objectKey - is key of object.
        Returns:
        byte string consisting of object number and object generation concatenated.