|
||||||||
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 | |
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() . |
EncryptionKey |
getKey()
Return the key used for encryption. |
int |
plainBlockSize()
Return the size of the blocks of plaintext encrypted by this object. |
void |
setKey(EncryptionKey key)
Set the key to use for encryption. |
Method Detail |
public EncryptionKey getKey()
public void setKey(EncryptionKey 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() throws PaddingException
public byte[] flush(byte[] source, int i, int length) throws PaddingException
encrypt(source,i,length)
followed by flush()
. Also releases any and all
resources.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
.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 1997-2001 Logi Ragnarsson - Distributed under the GPL