public class Ntlm
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private javax.crypto.Cipher |
cipher |
private javax.crypto.SecretKeyFactory |
fac |
private static char[] |
hex |
private java.lang.String |
hostname |
private MailLogger |
logger |
private MD4 |
md4 |
private java.lang.String |
ntdomain |
private java.lang.String |
password |
private byte[] |
type1 |
private byte[] |
type3 |
private java.lang.String |
username |
Constructor and Description |
---|
Ntlm(java.lang.String ntdomain,
java.lang.String hostname,
java.lang.String username,
java.lang.String password,
MailLogger logger)
Create an NTLM authenticator.
|
Modifier and Type | Method and Description |
---|---|
private byte[] |
calcLMHash() |
private byte[] |
calcNTHash() |
private byte[] |
calcResponse(byte[] key,
byte[] text) |
private void |
copybytes(byte[] dest,
int destpos,
java.lang.String src,
java.lang.String enc) |
java.lang.String |
generateType1Msg(int flags) |
java.lang.String |
generateType3Msg(java.lang.String challenge) |
private void |
init0() |
private byte[] |
makeDesKey(byte[] input,
int off)
Convert a 7 byte array to an 8 byte array (for a des key with parity).
|
private static java.lang.String |
toHex(byte[] b) |
private byte[] type1
private byte[] type3
private javax.crypto.SecretKeyFactory fac
private javax.crypto.Cipher cipher
private MD4 md4
private java.lang.String hostname
private java.lang.String ntdomain
private java.lang.String username
private java.lang.String password
private MailLogger logger
private static char[] hex
public Ntlm(java.lang.String ntdomain, java.lang.String hostname, java.lang.String username, java.lang.String password, MailLogger logger)
private void init0()
private void copybytes(byte[] dest, int destpos, java.lang.String src, java.lang.String enc)
public java.lang.String generateType1Msg(int flags)
private byte[] makeDesKey(byte[] input, int off)
private byte[] calcLMHash() throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
private byte[] calcNTHash() throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
private byte[] calcResponse(byte[] key, byte[] text) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public java.lang.String generateType3Msg(java.lang.String challenge)
private static java.lang.String toHex(byte[] b)