|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Descendants of EncryptSession encrypt arbtrarily large arrays of plaintext. A corresponding DecryptSession should be used for decryption.
Most EncryptSessions use a CipherKey object to do actual encryption and do additional computations to mask repetitions in the plaintext.
DecryptSession
Method Summary | |
void |
close()
Close files and kill threads owned by the object. |
byte[] |
encrypt(byte[] source,
int i,
int length)
Send bytes to the EncryptMode for encryption. |
byte[] |
flush()
Pads the internal buffer, encrypts it and returns the ciphertext. |
byte[] |
flush(byte[] source,
int i,
int length)
Equivalent to calling encrypt(source,i,length)
followed by flush() . |
CipherKey |
getKey()
Return the key used for encryption. |
int |
plainBlockSize()
Return the size of the blocks of plaintext encrypted by this object. |
void |
setKey(CipherKey key)
Set the key to use for encryption. |
Method Detail |
public CipherKey getKey()
public void setKey(CipherKey key) throws CryptoException
CryptoException
- if there is data in the internal buffer
which should be encrypted with the old key.public int plainBlockSize()
public byte[] flush()
public byte[] flush(byte[] source, int i, int length)
encrypt(source,i,length)
followed by flush()
.public byte[] encrypt(byte[] source, int i, int length)
Encrypt length
bytes from source
,
starting at i
and return the ciphertext. Data may be
encrypted in blocks in which case only whole blocks of ciphertext
are written to dest
. Any remaining plaintext will be
stored and prepended to source
in the next call to
encrypt
.
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |