org.keel.services.crypto
Interface Encryptor
- All Known Implementing Classes:
- AbstractEncryptor
- public interface Encryptor
| Field Summary |
static java.lang.String |
ROLE
|
| Method Summary |
byte[] |
decrypt(byte[] inputData)
Decrypt the data according to the appropriate algorithm. |
byte[] |
encrypt(byte[] inputData)
Encrypt the specified data according to the appropriate algorithm. |
byte[] |
hash(byte[] inputData)
Apply a one-way "hash" to the input data, rendering it unreadable. |
void |
setKey(java.lang.String newKey)
Set the encryption key - if this algorithm uses such a key |
ROLE
public static final java.lang.String ROLE
-
- See Also:
- Constant Field Values
decrypt
public byte[] decrypt(byte[] inputData)
throws NestedException
-
Decrypt the data according to the appropriate algorithm.
-
- Returns:
- The byte array containing the decrypted version of the input data.
- Throws:
ChainedException - If there is an error decrypting the data.
NestedException
encrypt
public byte[] encrypt(byte[] inputData)
throws NestedException
-
Encrypt the specified data according to the appropriate algorithm.
-
- Returns:
- The encrypted data as a byte array.
- Throws:
ChainedException - If there was an error during encryption.
NestedException
hash
public byte[] hash(byte[] inputData)
throws NestedException
-
Apply a one-way "hash" to the input data, rendering it unreadable. The hashed data cannot be decrypted, but the same input data will hash to the same hashed value. This is appropriate for information such as passwords.
-
- Parameters:
inputData -
- Returns:
- byte[]
- Throws:
NestedException
setKey
public void setKey(java.lang.String newKey)
-
Set the encryption key - if this algorithm uses such a key
-
- Parameters:
newKey - The encryption key to be used in subsequent encryption/decryption calls.
Please see keelframework.org for information about new Keel releases.