|
RADIUS Client API (V3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectEAPPacket
Class to handle EAP (Extensible Authentication Protocol) Encapsulated packet data. Packet format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Code | Identifier | Length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Type-Data ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Field Summary | |
static int |
CODE_FAILURE
Code value for failure = 4. |
static int |
CODE_REQUEST
Code value for request = 1. |
static int |
CODE_RESPONSE
Code value for response = 2. |
static int |
CODE_SUCCESS
Code value for success = 3. |
static int |
MAX_ATTRIBUTE_LENGTH
Maximum attribute length = 255. |
static int |
MINPACKET
Minimum packet size possible (except for StartEap) - 4. |
static int |
TYPE_AKA
Type for AKA - 23. |
static int |
TYPE_EXPANDED
Expanded = 254. |
static int |
TYPE_EXPERIMENTAL_TYPE
Experimental Type = 255. |
static int |
TYPE_GTC
Type value for Generic Token Card = 6. |
static int |
TYPE_IDENTITY
Type value for Identity = 1. |
static int |
TYPE_INTERNATIONALIZATION
Type for Internationalization = 28. |
static int |
TYPE_LEAP
Type for LEAP - 17. |
static int |
TYPE_MD5
Type value for MD5-Challenge = 4. |
static int |
TYPE_NAK
Type value for NAK = 3. |
static int |
TYPE_NOTIFICATION
Type value for Notification = 2. |
static int |
TYPE_OTP
Type value for One-Time Password = 5. |
static int |
TYPE_PEAP
Type for PEAP = 25. |
static int |
TYPE_SIM
Type for TTLS - 18. |
static int |
TYPE_TLS
Type for EAP-TLS = 13. |
static int |
TYPE_TTLS
Type for TTLS - 21. |
static int |
TYPE_UNDEFINED
Type value for undefined (no type field set or found) = 0. |
| Constructor Summary | |
EAPPacket()
Default constructor. |
|
EAPPacket(AttributeList list)
Create the EAP Packet from an attribute list. |
|
EAPPacket(byte[] eapData)
Constructor to disassemble an EAP packet from an EAP-Message packet. |
|
EAPPacket(int code,
int id,
int type,
byte[] data)
Constructor to create an EAP packet. |
|
EAPPacket(int code,
int id,
int vendorId,
int vendorType,
byte[] data)
Constructor to create an expanded vendor EAP packet. |
|
| Method Summary | |
static byte[] |
createChallenge16()
Create a sixteen byte challenge. |
static byte[] |
createChallenge8()
Create an eight byte challenge. |
AttributeList |
createExpandedNAK(int id,
int[] vendorIdList,
int[] vendorTypeList)
Create an Expanded NAK response. |
AttributeList |
createFailure(int id)
Send a Failure response. |
AttributeList |
createGTCRequest(int id,
byte[] message)
Send a Generic Token Card (6) request. |
AttributeList |
createGTCResponse(int id,
byte[] tcData)
Send a Generic Token Card (6) response. |
AttributeList |
createIdentityRequest(int id,
byte[] msg)
Send an Identity (1) request. |
AttributeList |
createIdentityResponse(int id,
byte[] identity)
Send an Identity (1) response. |
AttributeList |
createMD5Request(int id,
byte[] challenge)
Create an MD5-Challenge request. |
AttributeList |
createMD5Response(int id,
byte[] challenge,
byte[] password)
Create an MD5 response. |
AttributeList |
createNAKResponse(int id,
byte[] data)
Send a NAK response indicating the desired authentication type. |
AttributeList |
createNotificationRequest(int id,
byte[] message)
Send a Notification (2) request. |
AttributeList |
createNotificationResponse(int id)
Send a Notification (2) response. |
AttributeList |
createOTPRequest(int id,
byte[] message)
Send a One-Time Password (OTP) (5) request. |
AttributeList |
createOTPResponse(int id,
byte[] tcData)
Send a One-Time Password (OTP) (5) response. |
static int |
createPacketIdentifier()
Create a random packet identifier. |
AttributeList |
createStart(int id)
Create an EAP Start packet. |
AttributeList |
createSuccess(int id)
Send a Success response. |
int |
getCode()
Get the code value. |
String |
getCodeName()
Get the code's name. |
byte[] |
getData()
Get the raw payload data of the EAP packet. |
byte[] |
getEAPPacketData()
Get the full EAP Packet data. |
String |
getIdentity()
Get the identity from an Identity EAP packet. |
byte[] |
getIdentityBytes()
Get the identity from an Identity EAP packet. |
int |
getLength()
Get the length of the packet data. |
int |
getPacketIdentifier()
Get the packet packetIdentifier. |
int |
getType()
Get the type value; |
String |
getTypeName()
Get the type value's name. |
String |
getTypeName(int type)
Get the type value's name. |
int |
getVendorId()
Get the vendor Id for expanded packets. |
int |
getVendorType()
Get the vendor type for expanded packets. |
boolean |
isEAPProtocol(int protocol)
Determine if this is an expected EAP type packet. |
boolean |
isEAPStart()
Determine if this is an EAP-Start packet. |
boolean |
isEAPTLS()
Determine if this is an EAP-TLS packet. |
boolean |
isFailure()
Determine if this packet is a failure response. |
boolean |
isIdentity()
Determine if this packet is an identity packet. |
boolean |
isNAK()
Determine if this packet type is a NAK. |
boolean |
isRequest()
Determine if the packet is a request. |
boolean |
isResponse()
Determine if the packet is a response. |
boolean |
isSuccess()
Determine if this packet is a success response. |
void |
setCode(int code)
Set the code. |
void |
setData(byte[] data)
Set the raw data field for the EAP packet not including any type field. |
void |
setData(int type,
byte[] data)
Set the raw data field for the EAP packet that requires a type. |
void |
setFailure()
Make this packet a failure. |
void |
setPacketIdentifier(int id)
Set the packet packetIdentifier. |
void |
setRequest()
Make this packet a request. |
void |
setResponse()
Make this packet a response. |
void |
setSuccess()
Make this packet a success. |
AttributeList |
toAttributeList()
Return the EAP packet as a RADIUS attribute. |
AttributeList |
toServerAttributeList()
Return the EAP packet as a RADIUS attribute. |
String |
toString()
String representation of the EAP packet. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int CODE_REQUEST
public static final int CODE_RESPONSE
public static final int CODE_SUCCESS
public static final int CODE_FAILURE
public static final int TYPE_UNDEFINED
public static final int TYPE_IDENTITY
public static final int TYPE_NOTIFICATION
public static final int TYPE_NAK
public static final int TYPE_MD5
public static final int TYPE_OTP
public static final int TYPE_GTC
public static final int TYPE_TLS
public static final int TYPE_PEAP
public static final int TYPE_LEAP
public static final int TYPE_TTLS
public static final int TYPE_SIM
public static final int TYPE_AKA
public static final int TYPE_INTERNATIONALIZATION
public static final int TYPE_EXPANDED
public static final int TYPE_EXPERIMENTAL_TYPE
public static final int MAX_ATTRIBUTE_LENGTH
public static final int MINPACKET
| Constructor Detail |
public EAPPacket()
public EAPPacket(byte[] eapData)
throws EAPException
eapData - bytes holding the EAP packet data which would be the data portion of
an EAP-Message attribute.
RADIUSException - if there is no EAP-Message attribute.
EAPException
public EAPPacket(int code,
int id,
int type,
byte[] data)
code - The code field value.id - Packet Id.type - The type field value.data - The data value.
RADIUSException - if the EAP code is out of range or the physical size of the
packet is incorrect.
public EAPPacket(int code,
int id,
int vendorId,
int vendorType,
byte[] data)
code - The code field value.id - Packet Id.vendorId - Vendor identifier.vendorType - Vendor type.data - The data value.
RADIUSException - if the EAP code is out of range or the physical size of the
packet is incorrect.
public EAPPacket(AttributeList list)
throws EAPException
list - List of request attributes.
EAPException - if the EAP packet data is malformed.| Method Detail |
public int getCode()
public String getCodeName()
public int getType()
public String getTypeName()
public String getTypeName(int type)
public int getLength()
public byte[] getData()
getType()public byte[] getEAPPacketData()
public String getIdentity()
public byte[] getIdentityBytes()
getIdentity().
public int getPacketIdentifier()
public int getVendorId()
public int getVendorType()
public boolean isEAPStart()
"In cases where an EAP-Request/Identity packet will not be sent, the NAS will send to the RADIUS server a RADIUS Access-Request packet containing an EAP-Message attribute signifying EAP-Start. EAP-Start is indicated by sending an EAP- Message attribute with a length of 2 (no data)."
public boolean isEAPTLS()
public boolean isEAPProtocol(int protocol)
protocol - EAP protocol like EAP-TLS, PEAP, etc.
public AttributeList createStart(int id)
id - Packet packetIdentifier.
public void setCode(int code)
code - EAP Code value.public void setData(byte[] data)
setData().
data - Data portion of packet.
public void setData(int type,
byte[] data)
type - Type field value.data - Data to follow the type field.
If the data field is null no data will be sent, only the type.public void setPacketIdentifier(int id)
id - Packet packetIdentifier.public void setRequest()
public void setResponse()
public void setFailure()
public void setSuccess()
public AttributeList toAttributeList()
public AttributeList toServerAttributeList()
public AttributeList createIdentityRequest(int id,
byte[] msg)
id - Packet packetIdentifier.msg - to display, if any. If the message is null no message will be sent.
public AttributeList createIdentityResponse(int id,
byte[] identity)
id - Packet packetIdentifier.identity - Peer identity (UTF8 encoded).
public AttributeList createNotificationRequest(int id,
byte[] message)
id - Packet packetIdentifier.message - Notification message. If null no message is sent.
public AttributeList createNotificationResponse(int id)
id - Packet Identifier.
public AttributeList createExpandedNAK(int id,
int[] vendorIdList,
int[] vendorTypeList)
id - Packet Identifier.vendorIdList - List of vendor Id's.vendorTypeList - List of vendor types, each positionally matching the above vendorId list.
public AttributeList createMD5Request(int id,
byte[] challenge)
id - Packet packetIdentifier.challenge - Random challenge.
public AttributeList createMD5Response(int id,
byte[] challenge,
byte[] password)
id - Packet packetIdentifier.challenge - Raw MD5 challenge data including the Chap ID and challenge.
public AttributeList createOTPRequest(int id,
byte[] message)
id - Packet packetIdentifier.message - Displayable message containing an OTP challenge.
getData()
public AttributeList createOTPResponse(int id,
byte[] tcData)
id - Packet packetIdentifier.tcData - Token Card data (6 words from the OTP dictionary).
public AttributeList createGTCRequest(int id,
byte[] message)
id - Packet packetIdentifier.message - Display message. If null no message is sent.
public AttributeList createGTCResponse(int id,
byte[] tcData)
id - Packet packetIdentifier.tcData - Token Card data.
public AttributeList createFailure(int id)
id - Packet packetIdentifier.
public AttributeList createSuccess(int id)
id - Packet packetIdentifier.
public final AttributeList createNAKResponse(int id,
byte[] data)
id - Packet packetIdentifier.data - Optional data.
For example it's a list of EAP authentication types available for EAP-MD5.
public boolean isNAK()
public boolean isRequest()
public boolean isResponse()
public boolean isSuccess()
public boolean isFailure()
public boolean isIdentity()
public String toString()
public static int createPacketIdentifier()
public static byte[] createChallenge16()
public static byte[] createChallenge8()
|
RADIUS Client API (V3) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||