|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jalios.util.StringEncrypter
public class StringEncrypter
Encrypts and decrypts string using Java Cryptography Extension (JCE)
| Nested Class Summary | |
|---|---|
static class |
StringEncrypter.EncryptionException
Exception Wrapper for any error that might occur during the encryption or decryption process. |
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
StringEncrypter(java.lang.String encryptionScheme,
java.lang.String encryptionKey)
Create a new StringEncrypter using the specified encryption scheme and key. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
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 characters
StringEncrypter.EncryptionException| Method Detail |
|---|
public 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 empty
StringEncrypter.EncryptionException
public 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 empty
StringEncrypter.EncryptionException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||