You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/10/31 18:10:14 UTC
svn commit: r1029422 -
/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
Author: kayyagari
Date: Sun Oct 31 17:10:14 2010
New Revision: 1029422
URL: http://svn.apache.org/viewvc?rev=1029422&view=rev
Log:
o overloaded createStoragePassword() method
Modified:
directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java?rev=1029422&r1=1029421&r2=1029422&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordUtil.java Sun Oct 31 17:10:14 2010
@@ -121,6 +121,15 @@ public class PasswordUtil
/**
+ * @see #createStoragePassword(byte[], LdapSecurityConstants)
+ */
+ public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm )
+ {
+ return createStoragePassword( StringTools.getBytesUtf8( credentials ), algorithm );
+ }
+
+
+ /**
* create a hashed password in a format that can be stored in the server.
* If the specified algorithm requires a salt then a random salt of 8 byte size is used
*
@@ -128,7 +137,7 @@ public class PasswordUtil
* @param algorithm the hashing algorithm to be applied
* @return the password after hashing with the given algorithm
*/
- public static byte[] createStoragePassword( String credentials, LdapSecurityConstants algorithm )
+ public static byte[] createStoragePassword( byte[] credentials, LdapSecurityConstants algorithm )
{
byte[] salt;
@@ -157,7 +166,7 @@ public class PasswordUtil
salt = null;
}
- byte[] hashedPassword = encryptPassword( StringTools.getBytesUtf8( credentials ), algorithm, salt );
+ byte[] hashedPassword = encryptPassword( credentials, algorithm, salt );
StringBuffer sb = new StringBuffer();
if ( algorithm != null )