net.sf.jradius.util
Class RadiusUtils

java.lang.Object
  extended by net.sf.jradius.util.RadiusUtils

public final class RadiusUtils
extends java.lang.Object

Radius Utilities

Author:
David Bird

Constructor Summary
RadiusUtils()
           
 
Method Summary
static java.lang.String byteArrayToHexString(byte[] in)
          Converts a hex array to a human readable string
static byte[] encodePapPassword(java.security.MessageDigest md5, byte[] userPass, byte[] requestAuthenticator, java.lang.String sharedSecret)
          This method encodes the plaintext user password according to RFC 2865
static byte[] makeRFC2865RequestAuthenticator(java.security.MessageDigest md5, java.lang.String sharedSecret)
          This method builds a Request Authenticator for use in outgoing RADIUS Access-Request packets as specified in RFC 2865.
static byte[] makeRFC2865ResponseAuthenticator(java.security.MessageDigest md5, java.lang.String sharedSecret, byte code, byte identifier, short length, byte[] requestAuthenticator, byte[] responseAttributeBytes)
          This method builds a Response Authenticator for use in validating responses from the RADIUS Authentication process as specified in RFC 2865.
static byte[] makeRFC2866RequestAuthenticator(java.security.MessageDigest md5, java.lang.String sharedSecret, byte code, byte identifier, int length, byte[] requestAttributes)
          This method builds a Request Authenticator for use in RADIUS Accounting packets as specified in RFC 2866.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadiusUtils

public RadiusUtils()
Method Detail

encodePapPassword

public static byte[] encodePapPassword(java.security.MessageDigest md5,
                                       byte[] userPass,
                                       byte[] requestAuthenticator,
                                       java.lang.String sharedSecret)
This method encodes the plaintext user password according to RFC 2865

Parameters:
userPass - java.lang.String the password to encrypt
requestAuthenticator - byte[] the requestAuthenicator to use in the encryption
Returns:
byte[] the byte array containing the encrypted password

makeRFC2865RequestAuthenticator

public static byte[] makeRFC2865RequestAuthenticator(java.security.MessageDigest md5,
                                                     java.lang.String sharedSecret)
This method builds a Request Authenticator for use in outgoing RADIUS Access-Request packets as specified in RFC 2865.

Returns:
byte[]

makeRFC2865ResponseAuthenticator

public static byte[] makeRFC2865ResponseAuthenticator(java.security.MessageDigest md5,
                                                      java.lang.String sharedSecret,
                                                      byte code,
                                                      byte identifier,
                                                      short length,
                                                      byte[] requestAuthenticator,
                                                      byte[] responseAttributeBytes)
This method builds a Response Authenticator for use in validating responses from the RADIUS Authentication process as specified in RFC 2865. The byte array returned should match exactly the response authenticator recieved in the response packet.

Parameters:
code - byte
identifier - byte
length - short
requestAuthenticator - byte[]
responseAttributeBytes - byte[]
Returns:
byte[]

makeRFC2866RequestAuthenticator

public static byte[] makeRFC2866RequestAuthenticator(java.security.MessageDigest md5,
                                                     java.lang.String sharedSecret,
                                                     byte code,
                                                     byte identifier,
                                                     int length,
                                                     byte[] requestAttributes)
This method builds a Request Authenticator for use in RADIUS Accounting packets as specified in RFC 2866.

Parameters:
code - byte
identifier - byte
length - short
requestAttributes - byte[]
Returns:
byte[]

byteArrayToHexString

public static java.lang.String byteArrayToHexString(byte[] in)
Converts a hex array to a human readable string

Parameters:
in - bytes to be hexed
Returns:
Returns a hex string


Copyright © 2006 The JRadius Project, All Rights Reserved.