com.pushtotest.tool.util
Interface Crypt

All Superinterfaces:
Codec

public interface Crypt
extends Codec

This class provides an interface for building encryption methods. The interface facillitates building a 'plugin' type architecture.


Method Summary
 char[] decode(char[] chars)
          This method decodes the character array passed in and returns a decrypted version of the character array.
 java.lang.String decode(java.lang.String chars)
          This method decodes the string passed in and returns a decrypted version of the string.
 char[] encode(char[] chars)
          This method encodes the character array passed in and returns an encrypted character array.
 java.lang.String encode(java.lang.String chars)
          This method encodes the string passed in and returns the encrypted string.
 void init(java.lang.String key, java.util.Map map)
          Initialize the cryptographic functions.
 

Method Detail

init

void init(java.lang.String key,
          java.util.Map map)
Initialize the cryptographic functions.

Parameters:
key - The key to use with this object.
map - Any other parameters that are needed to initialize everything.

encode

java.lang.String encode(java.lang.String chars)
This method encodes the string passed in and returns the encrypted string.

Specified by:
encode in interface Codec
Parameters:
chars - The plain text string that should be encode
Returns:
The encrypted version of the string passed in.

encode

char[] encode(char[] chars)
This method encodes the character array passed in and returns an encrypted character array.

Specified by:
encode in interface Codec
Parameters:
chars - The plain text character array that should be encode
Returns:
The encrypted version of the character array passed in.

decode

char[] decode(char[] chars)
This method decodes the character array passed in and returns a decrypted version of the character array.

Specified by:
decode in interface Codec
Parameters:
chars - The plain text character array that should be encode
Returns:
The encrypted version of the character array passed in.

decode

java.lang.String decode(java.lang.String chars)
This method decodes the string passed in and returns a decrypted version of the string.

Specified by:
decode in interface Codec
Parameters:
chars - The plain text string that should be encode
Returns:
The encrypted version of the string passed in.