public class JCEPasswordEncryptor extends PasswordEncryptor
Provides password encryption for CIFS using the JCE framework.
| Modifier and Type | Field and Description |
|---|---|
static int |
LANMAN |
static int |
MD4 |
static int |
NTLM1 |
static int |
NTLM2 |
| Constructor and Description |
|---|
JCEPasswordEncryptor()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkEncryptionAlgorithms()
Check if the required algorithms are available
|
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.
|
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
|
byte[] |
P16(java.lang.String pwd,
byte[] s8)
P16 encryption
|
protected 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()
checkEncryptionAlgorithms in class PasswordEncryptorpublic byte[] generateEncryptedPassword(java.lang.String plainPwd,
byte[] encryptKey,
int alg)
throws java.security.NoSuchAlgorithmException
generateEncryptedPassword in class PasswordEncryptorplainPwd - Plaintext password stringencryptKey - byte[] Encryption keyalg - int Encryption algorithmjava.security.NoSuchAlgorithmException - If a required encryption algorithm is not availablepublic byte[] generateSessionKey(java.lang.String plainPwd,
byte[] encryptKey,
int alg)
throws java.security.NoSuchAlgorithmException
generateSessionKey in class PasswordEncryptorplainPwd - Plaintext password stringencryptKey - byte[] Encryption keyalg - int Encryption algorithmjava.security.NoSuchAlgorithmException - If a required encryption algorithm is not availablepublic final byte[] P16(java.lang.String pwd,
byte[] s8)
throws java.security.NoSuchAlgorithmException
P16 in class PasswordEncryptorpwd - java.lang.Strings8 - byte[]java.security.NoSuchAlgorithmException - If a required encryption algorithm is not availableprotected byte[] P24(byte[] p21,
byte[] ch)
throws java.security.NoSuchAlgorithmException
P24 in class PasswordEncryptorp21 - 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.