org.knopflerfish.service.um.useradmin
Class PasswdUtil
java.lang.Object
org.knopflerfish.service.um.useradmin.PasswdUtil
- public class PasswdUtil
- extends java.lang.Object
Utility class for one-way encryption of, for example, user passwords.
- Version:
- $Revision: 1.1.1.1 $
- Author:
- Gatespace AB
Method Summary |
static byte[] |
digest(java.lang.String message,
byte[] salt)
Create a digest from salt and a message. |
static byte[] |
saltAndDigest(java.lang.String message,
byte[] digest)
Create salt and the a digest of the salt and the message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PasswdUtil
public PasswdUtil()
saltAndDigest
public static byte[] saltAndDigest(java.lang.String message,
byte[] digest)
- Create salt and the a digest of the salt and the message.
- Parameters:
message
- the message to calculate a digest fordigest
- buffer to write the resulting digest to, must be at least 20
bytes long.
- Returns:
- the salt used when calculating the digest.
digest
public static byte[] digest(java.lang.String message,
byte[] salt)
- Create a digest from salt and a message.
- Parameters:
message
- the message to calculate a digest forsalt
- the salt to use.
- Returns:
- the resulting digest, will be 20 bytes long.