Package org.verapdf.cos.filters
Class COSFilterRC4DecryptionDefault
java.lang.Object
java.io.InputStream
org.verapdf.as.io.ASInputStream
org.verapdf.as.filters.ASInFilter
org.verapdf.as.filters.io.ASBufferedInFilter
org.verapdf.cos.filters.COSFilterRC4DecryptionDefault
- All Implemented Interfaces:
Closeable,AutoCloseable,BaseParserInputStream
Filter that decrypts data using RC4 cipher decryption according to Algorithm
1 of 7.6.2 of ISO 32000:2008.
- Author:
- Sergey Shemyakov
-
Field Summary
FieldsFields inherited from class org.verapdf.as.filters.io.ASBufferedInFilter
BF_BUFFER_SIZE, buffer, START_BUFFER_SIZEFields inherited from class org.verapdf.as.io.ASInputStream
isClosed, isSourceClosed, resourceUsers -
Constructor Summary
ConstructorsConstructorDescriptionCOSFilterRC4DecryptionDefault(ASInputStream stream, COSKey objectKey, byte[] encryptionKey) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]getObjectKeyDigest(COSKey objectKey) Gets a byte string consisting of object number and object generation concatenated.intread(byte[] buffer, int size) intread(byte[] buffer, int off, int size) voidreset()Methods inherited from class org.verapdf.as.filters.io.ASBufferedInFilter
addToBuffer, bufferPop, bufferPopArray, bufferSize, closeResource, concatenate, feedBuffer, getBufferBegin, getBufferCapacity, getBufferEnd, getReadCounter, getStream, getStreamUntilToken, initialize, isEOF, peek, peek, processBuffer, read, readByte, resetReadCounter, skip, unread, unreadMethods inherited from class org.verapdf.as.filters.ASInFilter
close, decrementResourceUsers, getInputStream, incrementResourceUsers, read, setInputStreamMethods inherited from class org.verapdf.as.io.ASInputStream
createStreamFromStreamMethods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, skip, skipNBytes, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.verapdf.parser.BaseParserInputStream
close, read
-
Field Details
-
MAXIMAL_KEY_LENGTH
public static final int MAXIMAL_KEY_LENGTH- See Also:
-
-
Constructor Details
-
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:
IOExceptionNoSuchAlgorithmException
-
-
Method Details
-
read
- Overrides:
readin classASBufferedInFilter- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
reset
- Overrides:
resetin classASBufferedInFilter- Throws:
IOException
-
getObjectKeyDigest
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.
-