Example:
Server server = new Server(null, "REALM") {
public char[] getPassword(String ntdomain, String username) {
switch (username) {
case "dummy": return "t0pSeCr3t".toCharArray();
case "guest": return "".toCharArray();
default: return null;
}
}
};
// Receive client request as type1
byte[] type2 = server.type2(type1, nonce);
// Send type2 to client and receive type3
verify(type3, nonce);
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | Server(String
the NTLM version to use, which can be:
version, String
the domain, must not be null domain)Creates a Server instance. |
| Modifier and Type | Method and Description |
|---|---|
| public abstract char[] | Returns: the password for the user, or null if unknowncan be null domain, String must not be null username)Retrieves the password for a given user. |
| public byte[] | Returns: the message generatedthe Type1 message received, must not be null type1, byte[] the random 8-byte array to be used in message generation,
must not be null nonce)Generates the Type 2 message |
| public String[] |
| allVersion | back to summary |
|---|---|
| private final boolean allVersion | |
| domain | back to summary |
|---|---|
| private final String domain | |
| Server | back to summary |
|---|---|
| public Server(String version, String domain) throws NTLMException Creates a Server instance.
| |
| getPassword | back to summary |
|---|---|
| public abstract char[] getPassword(String domain, String username) Retrieves the password for a given user. This method should be overridden in a concrete class. | |
| type2 | back to summary |
|---|---|
| public byte[] type2(byte[] type1, byte[] nonce) throws NTLMException Generates the Type 2 message
| |
| verify | back to summary |
|---|---|
| public String[] verify(byte[] type3, byte[] nonce) throws NTLMException Verifies the Type3 message received from client and returns various negotiated information.
| |