org.logi.crypto.modes
Interface DecryptSession

All Known Implementing Classes:
org.logi.crypto.modes.DecryptMode

public interface DecryptSession

DecryptSessions objects are used to decrypt ciphertext generated with a correpsonding EncryptSession object. They must in most cases be initialized with the appropriate key.

Author:
Logi Ragnarsson (logir@logi.org)
See Also:
EncryptSession

Method Summary
 void close()
          Close files and kill threads owned by the object.
 byte[] decrypt(byte[] source, int i, int length)
          Send bytes to the DecryptMode for decryption.
 CipherKey getKey()
          Return the key used for decryption.
 int plainBlockSize()
          Return the size of the blocks of plaintext output by this object.
 void setKey(CipherKey key)
          Set the key to use for encryption.
 

Method Detail

getKey

public CipherKey getKey()
Return the key used for decryption.

setKey

public void setKey(CipherKey key)
            throws CryptoException
Set the key to use for encryption. Do not call this method when there may be data in the internal buffer.
Throws:
CryptoException - if there is data in the internal buffer which should be encrypted with the old key.

plainBlockSize

public int plainBlockSize()
Return the size of the blocks of plaintext output by this object.

decrypt

public byte[] decrypt(byte[] source,
                      int i,
                      int length)
Send bytes to the DecryptMode for decryption.

Decrypt length bytes from source, starting at i and return the plaintext. Data may be encrypted in blocks in which case only whole blocks of plaintext are written to dest. Any remaining data will be stored and prepended to source in the next call to decrypt.


close

public void close()
Close files and kill threads owned by the object. This should be called to make sure all resources are freed.


Copyright 1997-2000 Logi Ragnarsson