Interface StorageCipher
@NonNullByDefault
public interface StorageCipher
This allows the encryption and decryption to be performed before saving to storage.
- Author:
- Gary Tse - Initial contribution
-
Method Details
-
getUniqueCipherId
String getUniqueCipherId()A unique cipher identifier per each implementation of StorageCipher. It allows the OAuthStoreHandler to choose which cipher implementation to use. This is particularly important when old ciphers becomes out-dated and need to be replaced by new implementations.- Returns:
- unique identifier
-
encrypt
Encrypt the plainText, then produce a base64 encoded cipher text- Parameters:
plainText
-- Returns:
- base64 encoded( encrypted( text ) )
- Throws:
GeneralSecurityException
- all security-related exception
-
decrypt
Decrypt the base64 encoded cipher text.- Parameters:
base64CipherText
- This should be the result from theencrypt(String)
- Returns:
- plain text
- Throws:
GeneralSecurityException
- all security-related exception
-