org.keel.services.crypto
Class AbstractEncryptor
java.lang.Object
org.keel.services.crypto.AbstractEncryptor
- All Implemented Interfaces:
- Encryptor
- Direct Known Subclasses:
- Base64, DES
- public abstract class AbstractEncryptor
- extends java.lang.Object
- implements Encryptor
| Field Summary |
static java.lang.String |
ROLE
|
| Method Summary |
abstract byte[] |
decrypt(byte[] inputData)
Decrypt the data according to the appropriate algorithm. |
abstract byte[] |
encrypt(byte[] inputData)
Encrypt the specified data according to the appropriate algorithm. |
byte[] |
hash(byte[] inputData)
"Hash" the given data |
abstract void |
setKey(java.lang.String newKey)
Set the encryption key - if this algorithm uses such a key |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ROLE
public static java.lang.String ROLE
-
AbstractEncryptor
public AbstractEncryptor()
decrypt
public abstract byte[] decrypt(byte[] inputData)
throws NestedException
- Description copied from interface:
Encryptor
-
Decrypt the data according to the appropriate algorithm.
-
- Specified by:
decrypt in interface Encryptor
-
- Returns:
- The byte array containing the decrypted version of the input data.
- Throws:
NestedException
encrypt
public abstract byte[] encrypt(byte[] inputData)
throws NestedException
- Description copied from interface:
Encryptor
-
Encrypt the specified data according to the appropriate algorithm.
-
- Specified by:
encrypt in interface Encryptor
-
- Returns:
- The encrypted data as a byte array.
- Throws:
NestedException
hash
public byte[] hash(byte[] inputData)
throws NestedException
-
"Hash" the given data
-
- Specified by:
hash in interface Encryptor
-
- Parameters:
inputData -
- Returns:
- Throws:
NestedException
setKey
public abstract void setKey(java.lang.String newKey)
- Description copied from interface:
Encryptor
-
Set the encryption key - if this algorithm uses such a key
-
- Specified by:
setKey in interface Encryptor
-
- Parameters:
newKey - The encryption key to be used in subsequent encryption/decryption calls.
Please see keelframework.org for information about new Keel releases.