Interface PlexusCipher
- All Known Implementing Classes:
DefaultPlexusCipher
public interface PlexusCipher
- Author:
- Oleg Gusakov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char
static final char
-
Method Summary
Modifier and TypeMethodDescriptiondecorated given string with { and }decrypt given base64 encrypted stringdecryptDecorated
(String str, String passPhrase) decrypt given base64 encoded encrypted string.encrypt given string with the given passPhrase and encode it into base64encryptAndDecorate
(String str, String passPhrase) encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorationsboolean
isEncryptedString
(String str) check if given string is decoratedunDecorate
(String str) return string inside decorations
-
Field Details
-
ENCRYPTED_STRING_DECORATION_START
static final char ENCRYPTED_STRING_DECORATION_START- See Also:
-
ENCRYPTED_STRING_DECORATION_STOP
static final char ENCRYPTED_STRING_DECORATION_STOP- See Also:
-
-
Method Details
-
encrypt
encrypt given string with the given passPhrase and encode it into base64- Parameters:
str
- string to encryptpassPhrase
- pass phrase- Returns:
- encrypted str
- Throws:
PlexusCipherException
- if encryption fails
-
encryptAndDecorate
encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { } decorations- Parameters:
str
- string to encryptpassPhrase
- pass phrase- Returns:
- encrypted and decorated str
- Throws:
PlexusCipherException
- if encryption fails
-
decrypt
decrypt given base64 encrypted string- Parameters:
str
- base64 encoded stringpassPhrase
- pass phrase- Returns:
- decrypted str
- Throws:
PlexusCipherException
- if decryption fails
-
decryptDecorated
decrypt given base64 encoded encrypted string. If string is decorated, decrypt base64 encoded string inside decorations- Parameters:
str
- base64 encoded stringpassPhrase
- pass phrase- Returns:
- decrypted decorated str
- Throws:
PlexusCipherException
- if decryption fails
-
isEncryptedString
check if given string is decorated- Parameters:
str
- string to check- Returns:
- true if string is encrypted
-
unDecorate
return string inside decorations- Parameters:
str
- decorated string- Returns:
- undecorated str
- Throws:
PlexusCipherException
- if decryption fails
-
decorate
decorated given string with { and }- Parameters:
str
- string to decorate- Returns:
- decorated str
-