public abstract class PasswordEncryptor
extends java.lang.Object
Generates LanMan and NTLMv1 encrypted passwords from the plain text password and challenge key.
Modifier and Type | Field and Description |
---|---|
static int |
LANMAN |
static int |
MD4 |
static int |
NTLM1 |
static int |
NTLM2 |
Constructor and Description |
---|
PasswordEncryptor()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkEncryptionAlgorithms()
Check if the required algorithms are available
|
abstract byte[] |
generateEncryptedPassword(java.lang.String plainPwd,
byte[] encryptKey,
int alg)
Encrypt the plain text password with the specified encryption key using the specified
encryption algorithm.
|
abstract byte[] |
generateSessionKey(java.lang.String plainPwd,
byte[] encryptKey,
int alg)
Generate a session key using the specified password and key.
|
static java.lang.String |
getAlgorithmName(int alg)
Return the encryption algorithm as a string
|
abstract byte[] |
P16(java.lang.String pwd,
byte[] s8)
P16 encryption
|
protected abstract byte[] |
P24(byte[] p21,
byte[] ch)
P24 DES encryption
|
public static final int LANMAN
public static final int NTLM1
public static final int NTLM2
public static final int MD4
public boolean checkEncryptionAlgorithms()
public abstract byte[] generateEncryptedPassword(java.lang.String plainPwd, byte[] encryptKey, int alg) throws java.security.NoSuchAlgorithmException
plainPwd
- Plaintext password stringencryptKey
- byte[] Encryption keyalg
- int Encryption algorithmjava.security.NoSuchAlgorithmException
- If a required encryption algorithm is not availablepublic abstract byte[] generateSessionKey(java.lang.String plainPwd, byte[] encryptKey, int alg) throws java.security.NoSuchAlgorithmException
plainPwd
- Plaintext password stringencryptKey
- byte[] Encryption keyalg
- int Encryption algorithmjava.security.NoSuchAlgorithmException
- If a required encryption algorithm is not availablepublic abstract byte[] P16(java.lang.String pwd, byte[] s8) throws java.security.NoSuchAlgorithmException
pwd
- java.lang.Strings8
- byte[]java.security.NoSuchAlgorithmException
- If a required encryption algorithm is not availableprotected abstract byte[] P24(byte[] p21, byte[] ch) throws java.security.NoSuchAlgorithmException
p21
- Plain password or hashed password bytesch
- Challenge bytesjava.security.NoSuchAlgorithmException
- If a required encryption algorithm is not availablepublic static java.lang.String getAlgorithmName(int alg)
alg
- intCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.