|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EncryptionAlgorithm
Describes operations common to both symmetric and asymmetric encryption algorithms.
| Method Summary | |
|---|---|
byte[] |
decrypt(byte[] ciphertext)
Decrypts the given ciphertext bytes into a byte array of plaintext using the decryption key. |
void |
decrypt(InputStream in,
OutputStream out)
Decrypts the data in the given ciphertext input stream into plaintext in the output stream. |
byte[] |
decrypt(String ciphertext,
Converter converter)
Decrypts a string representation of ciphertext bytes into a byte array of plaintext using the decryption key. |
byte[] |
encrypt(byte[] plaintext)
Encrypts the given plaintext bytes into a byte array of ciphertext using the encryption key. |
String |
encrypt(byte[] plaintext,
Converter converter)
Encrypts the given plaintext bytes into a ciphertext string using the conversion strategy provided by the given converter. |
void |
encrypt(InputStream in,
OutputStream out)
Encrypts the data in the given plaintext input stream into ciphertext in the output stream. |
int |
getBlockSize()
Gets the block size of the encryption algorithm cipher in bytes. |
int |
getCipherMode()
Gets the cipher mode indicating whether this instance is currently initialized for encryption or decryption. |
String |
getMode()
Gets the encryption mode. |
String |
getPadding()
Gets the encryption padding method. |
void |
initDecrypt()
Initializes this instance for decryption operations. |
void |
initEncrypt()
Initializes this instance for encryption operations. |
void |
setKey(Key k)
Sets the key used for encryption/decryption. |
| Methods inherited from interface edu.vt.middleware.crypt.Algorithm |
|---|
getAlgorithm, getRandomData, setRandomProvider |
| Method Detail |
|---|
String getMode()
String getPadding()
void setKey(Key k)
k - Public, private, or secret key used for encryption or
decryption.int getCipherMode()
initEncrypt() or initDecrypt().int getBlockSize()
void initEncrypt()
throws CryptException
CryptException - On cryptographic configuration errors.
void initDecrypt()
throws CryptException
CryptException - On cryptographic configuration errors.
byte[] encrypt(byte[] plaintext)
throws CryptException
plaintext - Input plaintext bytes.
CryptException - On encryption errors.
String encrypt(byte[] plaintext,
Converter converter)
throws CryptException
plaintext - Input plaintext bytes.converter - Converter that converts ciphertext output bytes to a
string representation.
CryptException - On encryption errors.
void encrypt(InputStream in,
OutputStream out)
throws CryptException,
IOException
Base64FilterOutputStream or HexFilterOutputStream to produce ciphertext in
the output stream in an encoded string repreprestation.
in - Input stream of plaintext.out - Output stream of ciphertext.
CryptException - On encryption errors.
IOException - On stream read/write errors.
byte[] decrypt(byte[] ciphertext)
throws CryptException
ciphertext - Input ciphertext bytes.
CryptException - On decryption errors.
byte[] decrypt(String ciphertext,
Converter converter)
throws CryptException
ciphertext - Input ciphertext bytes.converter - Converter that converts the ciphertext input string into
raw bytes required by the cipher algorithm.
CryptException - On decryption errors.
void decrypt(InputStream in,
OutputStream out)
throws CryptException,
IOException
Base64FilterInputStream or HexFilterInputStream to consume ciphertext in
an encoded string representation.
in - Input stream of ciphertext.out - Output stream of plaintext.
CryptException - On decryption errors.
IOException - On stream read/write errors.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||