org.safehaus.penrose.util
Class PasswordUtil

java.lang.Object
  extended byorg.safehaus.penrose.util.PasswordUtil

public class PasswordUtil
extends java.lang.Object

Author:
Endi S. Dewata

Field Summary
protected static boolean DEBUG
           
static org.slf4j.Logger log
           
static java.security.Provider SECURITY_PROVIDER
           
 
Constructor Summary
PasswordUtil()
           
 
Method Summary
static boolean comparePassword(java.lang.String credential, java.lang.Object digest)
           
static boolean comparePassword(java.lang.String credential, java.lang.String encryption, java.lang.String encoding, java.lang.String storedPassword)
           
static byte[] convert(byte[] str, int i)
           
static byte[] encrypt(java.lang.String method, byte[] bytes)
           
static byte[] encrypt(java.lang.String method, java.lang.String password)
           
static java.lang.String encrypt(java.lang.String method, java.lang.String encoding, java.lang.String password)
           
static byte[] encryptLMPassword(java.lang.Object password)
           
static byte[] encryptNTPassword(java.lang.Object password)
           
static java.lang.String getEncodingMethod(java.lang.Object password)
           
static java.lang.String getEncryptedPassword(java.lang.Object password)
           
static java.lang.String getEncryptionMethod(java.lang.Object password)
           
static byte[] toUnicodePassword(java.lang.Object password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.slf4j.Logger log

DEBUG

protected static final boolean DEBUG
See Also:
Constant Field Values

SECURITY_PROVIDER

public static java.security.Provider SECURITY_PROVIDER
Constructor Detail

PasswordUtil

public PasswordUtil()
Method Detail

encrypt

public static java.lang.String encrypt(java.lang.String method,
                                       java.lang.String encoding,
                                       java.lang.String password)
                                throws java.lang.Exception
Throws:
java.lang.Exception

encrypt

public static byte[] encrypt(java.lang.String method,
                             java.lang.String password)
                      throws java.lang.Exception
Throws:
java.lang.Exception

encrypt

public static byte[] encrypt(java.lang.String method,
                             byte[] bytes)
                      throws java.lang.Exception
Throws:
java.lang.Exception

encryptNTPassword

public static byte[] encryptNTPassword(java.lang.Object password)
                                throws java.lang.Exception
Throws:
java.lang.Exception

convert

public static byte[] convert(byte[] str,
                             int i)

encryptLMPassword

public static byte[] encryptLMPassword(java.lang.Object password)
                                throws java.lang.Exception
Throws:
java.lang.Exception

comparePassword

public static boolean comparePassword(java.lang.String credential,
                                      java.lang.Object digest)
                               throws java.lang.Exception
Parameters:
credential -
digest -
Returns:
true if password matches the digest
Throws:
java.lang.Exception

comparePassword

public static boolean comparePassword(java.lang.String credential,
                                      java.lang.String encryption,
                                      java.lang.String encoding,
                                      java.lang.String storedPassword)
                               throws java.lang.Exception
Throws:
java.lang.Exception

toUnicodePassword

public static byte[] toUnicodePassword(java.lang.Object password)
                                throws java.lang.Exception
Parameters:
password -
Returns:
unicode password
Throws:
java.lang.Exception

getEncryptionMethod

public static java.lang.String getEncryptionMethod(java.lang.Object password)

getEncodingMethod

public static java.lang.String getEncodingMethod(java.lang.Object password)

getEncryptedPassword

public static java.lang.String getEncryptedPassword(java.lang.Object password)