| java.lang.Object org.mmbase.util.transformers.EncryptionTransformerFactory
EncryptionTransformerFactory | public class EncryptionTransformerFactory implements ParameterizedTransformerFactory<CharTransformer>(Code) | | This transformerfactory can encrypt and decrypt strings. The algorithm which is
used for encryption/decryption is parameterized, and defaults to AES. Since
these encryption algorithms return raw bytes, an encoding must be supplied
which is used to convert bytes to characters: either hexadecimal encoding
or base64.
author: Sander de Boer |
createTransformer | public CharTransformer createTransformer(Parameters parameters)(Code) | | Return a parameterized transformer, based on the given parameters. These can be the following:
- algorithm, defaults to 'AES'
- direction, can be 'encrypt' or 'decrypt'
- format, can be 'base64' or 'hex'
- key, defaults to '1234567890abcdef' (NOTE: the length of this key must match the requirements set by the algorithm
|
decode | public static byte[] decode(String input, String format) throws IllegalArgumentException(Code) | | Decode a given string to an array of bytes, using a given format.
This can throw an 'IllegalArgumentException' when the given input
string isn't correct according to the format.
|
encode | public static String encode(byte input, String format)(Code) | | Encode a given array of bytes to a string, using the given format.
This can be 'hex' or 'base64'.
|
|
|