org.pdfbox.encryption
Class ARCFour
java.lang.Object
org.pdfbox.encryption.ARCFour
public class ARCFour
extends java.lang.Object
This class is an implementation of the alleged RC4 algorithm.
void | setKey(byte[] key) - This will reset the key to be used.
|
void | write(InputStream data, OutputStream output) - This will encrypt and write the data.
|
void | write(byte aByte, OutputStream output) - This will encrypt and write the next byte.
|
void | write(byte[] data, OutputStream output) - This will encrypt and write the data.
|
void | write(byte[] data, int offset, int len, OutputStream output) - This will encrypt and write the data.
|
ARCFour
public ARCFour()
Constructor.
setKey
public void setKey(byte[] key)
This will reset the key to be used.
key
- The RC4 key used during encryption.
write
public void write(InputStream data,
OutputStream output)
throws IOException
This will encrypt and write the data.
data
- The data to encrypt.output
- The stream to write to.
write
public void write(byte aByte,
OutputStream output)
throws IOException
This will encrypt and write the next byte.
aByte
- The byte to encrypt.output
- The stream to write to.
write
public void write(byte[] data,
OutputStream output)
throws IOException
This will encrypt and write the data.
data
- The data to encrypt.output
- The stream to write to.
write
public void write(byte[] data,
int offset,
int len,
OutputStream output)
throws IOException
This will encrypt and write the data.
data
- The data to encrypt.offset
- The offset into the array to start reading data from.len
- The number of bytes to attempt to read.output
- The stream to write to.