org.logi.crypto.keys
Interface DecryptionKey

All Superinterfaces:
Key, java.security.Key, PrettyPrintable, java.io.Serializable
All Known Subinterfaces:
CipherKey
All Known Implementing Classes:
DHPrivateKey, RSAPrivateKey

public interface DecryptionKey
extends Key

This interface is implemented by keys which handle decryption of single blocks of data.

Author:
Logi Ragnarsson (logi@logi.org)

Fields inherited from interface java.security.Key
serialVersionUID
 
Method Summary
 int cipherBlockSize()
          Returns the size of the blocks that can be decrypted in one call to decrypt().
 void decrypt(byte[] source, int i, byte[] dest, int j)
          Decrypt one block of data.
 int plainBlockSize()
          Returns the size of the blocks that can be encrypted in one call to encrypt().
 
Methods inherited from interface org.logi.crypto.keys.Key
getAlgorithm, getFingerprint, getFingerprint, getSize, hashCode, matches, matchFingerprint, matchFingerprint
 
Methods inherited from interface org.logi.crypto.io.PrettyPrintable
prettyPrint, prettyPrint
 
Methods inherited from interface java.security.Key
getEncoded, getFormat
 

Method Detail

plainBlockSize

public int plainBlockSize()
Returns the size of the blocks that can be encrypted in one call to encrypt().

cipherBlockSize

public int cipherBlockSize()
Returns the size of the blocks that can be decrypted in one call to decrypt().

decrypt

public void decrypt(byte[] source,
                    int i,
                    byte[] dest,
                    int j)
Decrypt one block of data. The ciphertext is taken from source starting at offset i and plaintext is written to dest, starting at offset j.

The amount of data read and written will match the values returned by cipherBlockSize() and plainBlockSize().



Copyright (c) 1997-2001 Logi Ragnarsson - Distributed under the GPL