lumis.util.security
Class MessageDigestEncryptor

Package class diagram package MessageDigestEncryptor
java.lang.Object
  extended by lumis.util.security.MessageDigestEncryptor
All Implemented Interfaces:
IEncryptor

public class MessageDigestEncryptor
extends Object
implements IEncryptor

Uses a MessageDigest algorithm to encrypt data.

In the configuration, the value of algorithm node is used to specify the MessageDigest algorithm. If not specified the SHA-1 algorithm is used.

See Also:
MessageDigest

Constructor Summary
MessageDigestEncryptor()
           
 
Method Summary
 String decrypt(String value)
          Decrypts a string.
 String encrypt(String value)
          Encrypts a string.
 void init(Node configuration)
          This method is called only once and before any other method are called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageDigestEncryptor

public MessageDigestEncryptor()
Method Detail

init

public void init(Node configuration)
          throws Exception
Description copied from interface: IEncryptor
This method is called only once and before any other method are called. This allows the encryptor to initialize itself and read any custom configuration.

Specified by:
init in interface IEncryptor
Throws:
Exception

encrypt

public String encrypt(String value)
               throws Exception
Description copied from interface: IEncryptor
Encrypts a string.

Specified by:
encrypt in interface IEncryptor
Parameters:
value - the original string.
Returns:
the encrypted string.
Throws:
Exception

decrypt

public String decrypt(String value)
               throws Exception
Description copied from interface: IEncryptor
Decrypts a string.

Specified by:
decrypt in interface IEncryptor
Parameters:
value - the encrypted string.
Returns:
the string decrypted.
Throws:
Exception


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.