- All Implemented Interfaces:
Encrypter<String>
- Author:
- Luca Frosini (ISTI - CNR)
-
Method Summary
Decrypts the string with the context key
Decrypts the string with the given key
Encrypts the string with the context Key
Encrypts the string with the given key
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
getEncrypter
- Returns:
- the encrypter
-
encrypt
Encrypts the string with the context Key
- Specified by:
encrypt in interface Encrypter<String>
- Parameters:
string - the string to encrypt
- Returns:
- the encrypted string in a Base64 encoding
- Throws:
Exception - if encryption fails
-
encrypt
Encrypts the string with the given key
- Specified by:
encrypt in interface Encrypter<String>
- Parameters:
string - the string to encrypt
ekey - the key for encrypting
- Returns:
- the encrypted string in a Base64 encoding
- Throws:
Exception - if encryption fails
-
decrypt
Decrypts the string with the context key
- Specified by:
decrypt in interface Encrypter<String>
- Parameters:
string - the encrypted string to decrypt
- Returns:
- the decrypted string
- Throws:
Exception - if decryption fails
-
decrypt
Decrypts the string with the given key
- Specified by:
decrypt in interface Encrypter<String>
- Parameters:
string - the encrypted string to decrypt
dkey - the key to use for decrypting
- Returns:
- the decrypted string
- Throws:
Exception - if decryption fails