| java.lang.Object org.acegisecurity.util.EncryptionUtils
EncryptionUtils | final public class EncryptionUtils (Code) | | A static utility class that can encrypt and decrypt text.
This class is useful if you have simple needs and wish to use the DESede
encryption cipher. More sophisticated requirements will need to use the
Java crypto libraries directly.
author: Alan Stewart author: Ben Alex version: $Id: EncryptionUtils.java 1784 2007-02-24 21:00:24Z luke_t $ |
Method Summary | |
public static String | byteArrayToString(byte[] byteArray) Converts a byte array into a String using UTF-8, falling back to the
platform's default character set if UTF-8 fails. | public static String | decrypt(String key, String inputString) Decrypts the inputString using the key. | public static byte[] | decrypt(String key, byte[] inputBytes) Decrypts the inputBytes using the key. | public static String | encrypt(String key, String inputString) Encrypts the inputString using the key. | public static byte[] | encrypt(String key, byte[] inputBytes) Encrypts the inputBytes using the key. | public static byte[] | stringToByteArray(String input) Converts a String into a byte array using UTF-8, falling back to the
platform's default character set if UTF-8 fails. |
byteArrayToString | public static String byteArrayToString(byte[] byteArray)(Code) | | Converts a byte array into a String using UTF-8, falling back to the
platform's default character set if UTF-8 fails.
Parameters: byteArray - the byte array to convert (required) a string representation of the byte array |
decrypt | public static String decrypt(String key, String inputString) throws EncryptionException(Code) | | Decrypts the inputString using the key.
Parameters: key - the key used to originally encrypt the string (required) Parameters: inputString - the encrypted string (required) the decrypted version of inputString throws: EncryptionException - in the event of an encryption failure |
decrypt | public static byte[] decrypt(String key, byte[] inputBytes) throws EncryptionException(Code) | | Decrypts the inputBytes using the key.
Parameters: key - the key used to originally encrypt the string (required) Parameters: inputBytes - the encrypted bytes (required) the decrypted version of inputBytes throws: EncryptionException - in the event of an encryption failure |
encrypt | public static String encrypt(String key, String inputString) throws EncryptionException(Code) | | Encrypts the inputString using the key.
Parameters: key - at least 24 character long key (required) Parameters: inputString - the string to encrypt (required) the encrypted version of the inputString throws: EncryptionException - in the event of an encryption failure |
encrypt | public static byte[] encrypt(String key, byte[] inputBytes) throws EncryptionException(Code) | | Encrypts the inputBytes using the key.
Parameters: key - at least 24 character long key (required) Parameters: inputBytes - the bytes to encrypt (required) the encrypted version of the inputBytes throws: EncryptionException - in the event of an encryption failure |
stringToByteArray | public static byte[] stringToByteArray(String input)(Code) | | Converts a String into a byte array using UTF-8, falling back to the
platform's default character set if UTF-8 fails.
Parameters: input - the input (required) a byte array representation of the input string |
|
|