C# Class GSF.Communication.Radius.RadiusPacket

Represents a data packet transferred between RADIUS client and server.
Inheritance: ISupportBinaryImage
Show file Open project: GridProtectionAlliance/gsf Class Usage Examples

Public Properties

Property Type Description
Encoding System.Text.Encoding
EndianOrder System.EndianOrder

Public Methods

Method Description
CreateRequestAuthenticator ( string sharedSecret ) : byte[]

Generates an "Authenticator" value used in a RADIUS request packet sent by the client to server.

CreateResponseAuthenticator ( string sharedSecret, RadiusPacket requestPacket, RadiusPacket responsePacket ) : byte[]

Generates an "Authenticator" value used in a RADIUS response packet sent by the server to client.

EncryptPassword ( string password, string sharedSecret, byte requestAuthenticator ) : byte[]

Generates an encrypted password using the RADIUS protocol specification (RFC 2285).

GenerateBinaryImage ( byte buffer, int startIndex ) : int

Generates a binary representation of this RadiusPacket object and copies it into the given buffer.

GetAttributeValue ( AttributeType attributeType ) : byte[]

Gets the value of the specified attributeType if it is present in the RadiusPacket.

ParseBinaryImage ( byte buffer, int startIndex, int length ) : int

Parses RadiusPacket object by parsing the specified buffer containing a binary image.

RadiusPacket ( ) : System

Initializes a new instance of the RadiusPacket class.

RadiusPacket ( PacketType type ) : System

Initializes a new instance of the RadiusPacket class.

RadiusPacket ( byte binaryImage, int startIndex, int length ) : System

Initializes a new instance of the RadiusPacket class.

Method Details

CreateRequestAuthenticator() public static method

Generates an "Authenticator" value used in a RADIUS request packet sent by the client to server.
public static CreateRequestAuthenticator ( string sharedSecret ) : byte[]
sharedSecret string The shared secret to be used in generating the output.
return byte[]

CreateResponseAuthenticator() public static method

Generates an "Authenticator" value used in a RADIUS response packet sent by the server to client.
public static CreateResponseAuthenticator ( string sharedSecret, RadiusPacket requestPacket, RadiusPacket responsePacket ) : byte[]
sharedSecret string The shared secret key.
requestPacket RadiusPacket RADIUS packet sent from client to server.
responsePacket RadiusPacket RADIUS packet sent from server to client.
return byte[]

EncryptPassword() public static method

Generates an encrypted password using the RADIUS protocol specification (RFC 2285).
public static EncryptPassword ( string password, string sharedSecret, byte requestAuthenticator ) : byte[]
password string User's password.
sharedSecret string Shared secret key.
requestAuthenticator byte Request authenticator byte array.
return byte[]

GenerateBinaryImage() public method

Generates a binary representation of this RadiusPacket object and copies it into the given buffer.
is null. /// or is less than 0 -or- /// and will exceed length. ///
public GenerateBinaryImage ( byte buffer, int startIndex ) : int
buffer byte Buffer used to hold generated binary image of the source object.
startIndex int 0-based starting index in the to start writing.
return int

GetAttributeValue() public method

Gets the value of the specified attributeType if it is present in the RadiusPacket.
public GetAttributeValue ( AttributeType attributeType ) : byte[]
attributeType AttributeType of the whose value is to be retrieved.
return byte[]

ParseBinaryImage() public method

Parses RadiusPacket object by parsing the specified buffer containing a binary image.
is null.
public ParseBinaryImage ( byte buffer, int startIndex, int length ) : int
buffer byte Buffer containing binary image to parse.
startIndex int 0-based starting index in the to start parsing.
length int Valid number of bytes within from .
return int

RadiusPacket() public method

Initializes a new instance of the RadiusPacket class.
public RadiusPacket ( ) : System
return System

RadiusPacket() public method

Initializes a new instance of the RadiusPacket class.
public RadiusPacket ( PacketType type ) : System
type PacketType Type of the .
return System

RadiusPacket() public method

Initializes a new instance of the RadiusPacket class.
public RadiusPacket ( byte binaryImage, int startIndex, int length ) : System
binaryImage byte Binary image to be used for initializing .
startIndex int 0-based starting index of initialization data in the .
length int Valid number of bytes in from .
return System

Property Details

Encoding public static property

Encoding format for encoding text.
public static Encoding,System.Text Encoding
return System.Text.Encoding

EndianOrder public static property

EndianOrder to use for byte conversion.
public static EndianOrder,System EndianOrder
return System.EndianOrder