@Named(value="default") @Typed(value=PlexusCipher.class) public class DefaultPlexusCipher extends java.lang.Object implements PlexusCipher
| Modifier and Type | Field and Description |
|---|---|
private PBECipher |
_cipher |
private static java.util.regex.Pattern |
ENCRYPTED_STRING_PATTERN |
ENCRYPTED_STRING_DECORATION_START, ENCRYPTED_STRING_DECORATION_STOP| Constructor and Description |
|---|
DefaultPlexusCipher() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
decorate(java.lang.String str)
decorated given string with { and }
|
java.lang.String |
decrypt(java.lang.String str,
java.lang.String passPhrase)
decrypt given base64 encrypted string
|
java.lang.String |
decryptDecorated(java.lang.String str,
java.lang.String passPhrase)
decrypt given base64 encoded encrypted string.
|
java.lang.String |
encrypt(java.lang.String str,
java.lang.String passPhrase)
encrypt given string with the given passPhrase and encode it into base64
|
java.lang.String |
encryptAndDecorate(java.lang.String str,
java.lang.String passPhrase)
encrypt given string with the given passPhrase, encode it into base64 and return result, wrapped into { }
decorations
|
static java.lang.String[] |
getCryptoImpls(java.lang.String serviceType)
This method returns the available implementations for a service type
|
static java.lang.String[] |
getServiceTypes()
Exploratory part.
|
boolean |
isEncryptedString(java.lang.String str)
check if given string is decorated
|
static void |
main(java.lang.String[] args) |
java.lang.String |
unDecorate(java.lang.String str)
return string inside decorations
|
private static final java.util.regex.Pattern ENCRYPTED_STRING_PATTERN
private final PBECipher _cipher
public DefaultPlexusCipher()
throws PlexusCipherException
PlexusCipherExceptionpublic java.lang.String encrypt(java.lang.String str,
java.lang.String passPhrase)
throws PlexusCipherException
PlexusCipherencrypt in interface PlexusCipherPlexusCipherExceptionpublic java.lang.String encryptAndDecorate(java.lang.String str,
java.lang.String passPhrase)
throws PlexusCipherException
PlexusCipherencryptAndDecorate in interface PlexusCipherPlexusCipherExceptionpublic java.lang.String decrypt(java.lang.String str,
java.lang.String passPhrase)
throws PlexusCipherException
PlexusCipherdecrypt in interface PlexusCipherPlexusCipherExceptionpublic java.lang.String decryptDecorated(java.lang.String str,
java.lang.String passPhrase)
throws PlexusCipherException
PlexusCipherdecryptDecorated in interface PlexusCipherPlexusCipherExceptionpublic boolean isEncryptedString(java.lang.String str)
PlexusCipherisEncryptedString in interface PlexusCipherpublic java.lang.String unDecorate(java.lang.String str)
throws PlexusCipherException
PlexusCipherunDecorate in interface PlexusCipherPlexusCipherExceptionpublic java.lang.String decorate(java.lang.String str)
PlexusCipherdecorate in interface PlexusCipherpublic static java.lang.String[] getServiceTypes()
public static java.lang.String[] getCryptoImpls(java.lang.String serviceType)
public static void main(java.lang.String[] args)