com.ericdaugherty.mail.server.configuration
Class PasswordManager

java.lang.Object
  extended by com.ericdaugherty.mail.server.configuration.PasswordManager

public class PasswordManager
extends java.lang.Object

Creates encrypted passwords. Also used to validate passwords from incoming connections.

Author:
Eric Daugherty, Andreas Kyrmegalos (2.x branch)

Constructor Summary
PasswordManager()
           
 
Method Summary
static java.lang.String encryptPassword(java.lang.String password)
          Creates a one-way has of the specified password.
static java.lang.String encryptPassword(java.lang.String username, java.lang.String realm, java.lang.String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordManager

public PasswordManager()
Method Detail

encryptPassword

public static java.lang.String encryptPassword(java.lang.String password)
Creates a one-way has of the specified password. This allows passwords to be safely stored in the database without any way to retrieve the original value.

Parameters:
password - the string to encrypt.
Returns:
the encrypted password, or null if encryption failed.

encryptPassword

public static java.lang.String encryptPassword(java.lang.String username,
                                               java.lang.String realm,
                                               java.lang.String password)
                                        throws java.security.GeneralSecurityException
Throws:
java.security.GeneralSecurityException