Class RequestAuthenticator

  • All Implemented Interfaces:
    Authenticator

    public class RequestAuthenticator
    extends Object
    implements Authenticator
    The Request Authenticator implementation as outlined in section 3 of RFC 2865. This class is used in both radius client functionality such as the RADIUS authentication module and in radius server functionality when receiving access-requests and then sending responses.
    • Constructor Detail

      • RequestAuthenticator

        public RequestAuthenticator​(SecureRandom rand,
                                    String secret)
                             throws NoSuchAlgorithmException
        Generates a request authenticator field consisting of a 16 octet random number per section 3 of RFC 2865.
        Parameters:
        rand - in instance of SecureRandom as the source of randomness.
        secret - the secret shared between a radius client and server.
        Throws:
        NoSuchAlgorithmException - if the MD5 algorithm is not available.
      • RequestAuthenticator

        public RequestAuthenticator​(byte[] octets)
        Generates a request authenticator field consisting of the 16 octets from the on-the-wire form of a packet.
        Parameters:
        octets - the on-the-wire bytes.
    • Method Detail

      • getOctets

        public byte[] getOctets()
        Returns the contained on-the-wire bytes of the authenticator.
        Specified by:
        getOctets in interface Authenticator
        Returns:
        the on-the-wire representation of this authenticator.