org.apache.commons.vfs.util
Class DefaultCryptor

java.lang.Object
  extended by org.apache.commons.vfs.util.DefaultCryptor
All Implemented Interfaces:
Cryptor

public class DefaultCryptor
extends Object
implements Cryptor

Allows passwords to be encrypted and decrypted.

Author:
Commons VFS team

Constructor Summary
DefaultCryptor()
           
 
Method Summary
 String decrypt(String encryptedKey)
          Decrypts the password.
 String encrypt(String plainKey)
          Encrypt the plain text password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCryptor

public DefaultCryptor()
Method Detail

encrypt

public String encrypt(String plainKey)
               throws Exception
Encrypt the plain text password.

Specified by:
encrypt in interface Cryptor
Parameters:
plainKey - The password.
Returns:
The encrypted password String.
Throws:
Exception - If an error occurs.

decrypt

public String decrypt(String encryptedKey)
               throws Exception
Decrypts the password.

Specified by:
decrypt in interface Cryptor
Parameters:
encryptedKey - the encrypted password.
Returns:
The plain text password.
Throws:
Exception - If an error occurs.


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.