public class StringEncrypter
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
StringEncrypter.EncryptionException
Exception Wrapper for any error that might occur during
the encryption or decryption process.
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DES_ENCRYPTION_SCHEME
DES encryption scheme.
|
static java.lang.String |
DESEDE_ENCRYPTION_SCHEME
DES3 (DESede) encryption scheme.
|
static java.lang.String |
REVISION |
| Constructor and Description |
|---|
StringEncrypter(java.lang.String encryptionScheme,
java.lang.String encryptionKey)
Create a new StringEncrypter using the specified encryption scheme and key.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
decrypt(java.lang.String encryptedString)
Decrypt the specified string using this StringEncrypter.
|
java.lang.String |
encrypt(java.lang.String unencryptedString)
Encrypt the specified string using this StringEncrypter.
|
public static final java.lang.String REVISION
public static final java.lang.String DESEDE_ENCRYPTION_SCHEME
public static final java.lang.String DES_ENCRYPTION_SCHEME
public StringEncrypter(java.lang.String encryptionScheme,
java.lang.String encryptionKey)
throws StringEncrypter.EncryptionException
encryptionScheme - an encryption scheme from one of the following :
DESEDE_ENCRYPTION_SCHEME or DES_ENCRYPTION_SCHEMEencryptionKey - the key to use for the encrypter, must be a
valid string of 24 or more characters, must not be null.java.lang.IllegalArgumentException - if encryptionKey is null or less than 24 charactersStringEncrypter.EncryptionExceptionpublic java.lang.String encrypt(java.lang.String unencryptedString)
throws StringEncrypter.EncryptionException
unencryptedString - the string to encrypt, must not be null or empty.java.lang.IllegalArgumentException - if unencryptedString is null or emptyStringEncrypter.EncryptionExceptionpublic java.lang.String decrypt(java.lang.String encryptedString)
throws StringEncrypter.EncryptionException
encryptedString - the string to decrypt, must not be null or empty.java.lang.IllegalArgumentException - if encryptedString is null or emptyStringEncrypter.EncryptionExceptionCopyright © 2001-2017 Jalios SA. All Rights Reserved.