AXL Software™

com.theorem.tacacs
Class AuthenticationPacket

Object
  extended byPacket
      extended byAuthenticationPacket

public final class AuthenticationPacket
extends Packet

Class providing the reply to an Authentication request. This class holds the information provided by an Authentication reply packet.

See Also:
TACACSClient, TACACSCallback

Constructor Summary
AuthenticationPacket()
          Default Constructor.
 
Method Summary
 byte[] createARAP(byte[] password)
          Create an ARAP challenges & response.
static byte[] createChap(String password)
          Create Chap data field.
 byte[] createMSCHAP(byte[] password)
          Create an MS-CHAP password from a non-plain text (or plain text) password.
 byte[] getARAPChallenge()
          Get the ARAP response challenge.
 byte[] getData()
          Get the authentication reply data field contents.
 int getFlags()
          Get the flags from a reply packet.
 PacketHeader getPacketHeader()
          Get the packet header.
 String getServerMessage()
          Get the server message from an Auththentication reply
 int getStatus()
          Get the status flag.
 String getStatusName(int status)
          Get the authentication status name for the value.
 String getUserMessage()
          Get the user message from a Authentication Continue reply suitable for displaying.
 void setData(byte[] data)
          Set the data field contents.
 void setUserMessage(byte[] userMessage)
          Set the user message in response to a server message.
 boolean verifyARAP(byte[] password, byte[] respChallenge)
          Verify the ARAP information returned from the server
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationPacket

public AuthenticationPacket()
Default Constructor.

Method Detail

getStatusName

public String getStatusName(int status)
Get the authentication status name for the value.

Parameters:
status - Status value.
Returns:
Status name.

getServerMessage

public String getServerMessage()
Get the server message from an Auththentication reply

Returns:
Server message. If there is no server message an empty string is returned.

getUserMessage

public String getUserMessage()
Get the user message from a Authentication Continue reply suitable for displaying.

Returns:
User message. If there is no user message an empty string is returned.

getData

public byte[] getData()
Get the authentication reply data field contents.

Returns:
Data field contents. If there is not data an empty array is returned.

getStatus

public int getStatus()
Get the status flag.

Returns:
Status flag.

This is one of

The first two refer to all authentication types. The last three are used when the client does not pass the name or password (or other data) in the authentication packet. The server will prompt for the name and password and other data as required for the authentication method using CONTINUE packets.


getPacketHeader

public PacketHeader getPacketHeader()
Get the packet header.

Returns:
Packet header.

setUserMessage

public void setUserMessage(byte[] userMessage)
Set the user message in response to a server message.

Parameters:
userMessage - User message.

setData

public void setData(byte[] data)
Set the data field contents. The contents vary with the authentication method.

Parameters:
data - Data.

getFlags

public int getFlags()
Get the flags from a reply packet.

Returns:
flags

createChap

public static byte[] createChap(String password)
Create Chap data field.

Parameters:
password - Password.

createMSCHAP

public byte[] createMSCHAP(byte[] password)
                    throws TACACSException
Create an MS-CHAP password from a non-plain text (or plain text) password.

Parameters:
password - Plain text password to encode. It must not be in encoded in UNICODE format. The default UTF8 encoding is sufficient.
Throws:
TACACSException - if there's a problem instantiating the DES cipher.

createARAP

public byte[] createARAP(byte[] password)
                  throws TACACSException
Create an ARAP challenges & response.

Parameters:
password - Plain text password to encode.
Returns:
Authentication request data block. The password has a maximum length of 8 bytes.
Throws:
TACACSException - if there's a problem with DES encoding.

getARAPChallenge

public byte[] getARAPChallenge()
Get the ARAP response challenge.

This information should be saved after createARAP() method has been used. The challenge value is used to verify data in the reply packet using verifyARAP().

Returns:
ARAP response challenge.

verifyARAP

public boolean verifyARAP(byte[] password,
                          byte[] respChallenge)
                   throws TACACSException
Verify the ARAP information returned from the server

Parameters:
password - Plain text password.
respChallenge - Response challenge from the reply packet data.
Returns:
True if the password and challenge were found correct.
Throws:
TACACSException - if there's a problem with the DES cipher.

AXL Software™

Submit a bug report or feature request

Copyright 1998-2002 AXL Software™ PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.