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(String plainPwd,
byte[] encryptKey,
int alg)
Encrypt the plain text password with the specified encryption key using the specified
encryption algorithm.
|
byte[] |
generateSessionKey(String plainPwd,
byte[] encryptKey,
int alg)
Generate a session key using the specified password and key.
|
static String |
getAlgorithmName(int alg)
Return the encryption algorithm as a string
|
byte[] |
P16(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 PasswordEncryptor
public byte[] generateEncryptedPassword(String plainPwd, byte[] encryptKey, int alg) throws NoSuchAlgorithmException
generateEncryptedPassword
in class PasswordEncryptor
plainPwd
- Plaintext password stringencryptKey
- byte[] Encryption keyalg
- int Encryption algorithmNoSuchAlgorithmException
- If a required encryption algorithm is not availablepublic byte[] generateSessionKey(String plainPwd, byte[] encryptKey, int alg) throws NoSuchAlgorithmException
generateSessionKey
in class PasswordEncryptor
plainPwd
- Plaintext password stringencryptKey
- byte[] Encryption keyalg
- int Encryption algorithmNoSuchAlgorithmException
- If a required encryption algorithm is not availablepublic final byte[] P16(String pwd, byte[] s8) throws NoSuchAlgorithmException
P16
in class PasswordEncryptor
pwd
- java.lang.Strings8
- byte[]NoSuchAlgorithmException
- If a required encryption algorithm is not availableprotected byte[] P24(byte[] p21, byte[] ch) throws NoSuchAlgorithmException
P24
in class PasswordEncryptor
p21
- Plain password or hashed password bytesch
- Challenge bytesNoSuchAlgorithmException
- If a required encryption algorithm is not availablepublic static String getAlgorithmName(int alg)
alg
- intCopyright © 2005–2017 Alfresco Software. All rights reserved.