Interface PlexusCipher
-
- All Known Implementing Classes:
DefaultPlexusCipher
public interface PlexusCipher- Author:
- Oleg Gusakov
-
-
Field Summary
Fields Modifier and Type Field Description static charENCRYPTED_STRING_DECORATION_STARTstatic charENCRYPTED_STRING_DECORATION_STOP
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringdecorate(String str)decorated given string with { and }Stringdecrypt(String str, String passPhrase)decrypt given base64 encrypted stringStringdecryptDecorated(String str, String passPhrase)decrypt given base64 encoded encrypted string.Stringencrypt(String str, String passPhrase)encrypt given string with the given passPhrase and encode it into base64StringencryptAndDecorate(String str, String passPhrase)encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorationsbooleanisEncryptedString(String str)check if given string is decoratedStringunDecorate(String str)return string inside decorations
-
-
-
Field Detail
-
ENCRYPTED_STRING_DECORATION_START
static final char ENCRYPTED_STRING_DECORATION_START
- See Also:
- Constant Field Values
-
ENCRYPTED_STRING_DECORATION_STOP
static final char ENCRYPTED_STRING_DECORATION_STOP
- See Also:
- Constant Field Values
-
-
Method Detail
-
encrypt
String encrypt(String str, String passPhrase) throws PlexusCipherException
encrypt given string with the given passPhrase and encode it into base64- Parameters:
str-passPhrase-- Returns:
- Throws:
PlexusCipherException
-
encryptAndDecorate
String encryptAndDecorate(String str, String passPhrase) throws PlexusCipherException
encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorations- Parameters:
str-passPhrase-- Returns:
- Throws:
PlexusCipherException
-
decrypt
String decrypt(String str, String passPhrase) throws PlexusCipherException
decrypt given base64 encrypted string- Parameters:
str-passPhrase-- Returns:
- Throws:
PlexusCipherException
-
decryptDecorated
String decryptDecorated(String str, String passPhrase) throws PlexusCipherException
decrypt given base64 encoded encrypted string. If string is decorated, decrypt base64 encoded string inside decorations- Parameters:
str-passPhrase-- Returns:
- Throws:
PlexusCipherException
-
isEncryptedString
boolean isEncryptedString(String str)
check if given string is decorated- Parameters:
str-- Returns:
-
unDecorate
String unDecorate(String str) throws PlexusCipherException
return string inside decorations- Parameters:
str-- Returns:
- Throws:
PlexusCipherException
-
-