Package org.jivesoftware.util
Interface Encryptor
-
- All Known Implementing Classes:
AesEncryptor
,Blowfish
public interface Encryptor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
decrypt(String value)
Decrypt an encrypted String.String
decrypt(String value, byte[] iv)
Decrypt an encrypted String.String
encrypt(String value)
Encrypt a clear text String.String
encrypt(String value, byte[] iv)
Encrypt a clear text String.void
setKey(String key)
Set the encryption key.
-
-
-
Method Detail
-
encrypt
String encrypt(String value)
Encrypt a clear text String.- Parameters:
value
- The clear text attribute- Returns:
- The encrypted attribute, or null
-
encrypt
String encrypt(String value, byte[] iv)
Encrypt a clear text String.- Parameters:
value
- The clear text attributeiv
- The IV to use, or null for the default IV- Returns:
- The encrypted attribute, or null
-
decrypt
String decrypt(String value)
Decrypt an encrypted String.- Parameters:
value
- The encrypted attribute in Base64 encoding- Returns:
- The clear text attribute, or null
-
decrypt
String decrypt(String value, byte[] iv)
Decrypt an encrypted String.- Parameters:
value
- The encrypted attribute in Base64 encodingiv
- The IV to use, or null for the default IV- Returns:
- The clear text attribute, or null
-
setKey
void setKey(String key)
Set the encryption key. This will apply the user-defined key, truncated or filled (via the default key) as needed to meet the key length specifications.- Parameters:
key
- The encryption key
-
-