Interface RadiusResponse

All Superinterfaces:
AttributeHolder<RadiusResponse>, NestedAttributeHolder<RadiusResponse>, RadiusPacket<RadiusResponse>
All Known Implementing Classes:
AccessResponse, AccessResponse.Accept, AccessResponse.Challenge, AccessResponse.Reject, GenericResponse

public interface RadiusResponse
extends RadiusPacket<RadiusResponse>
  • Method Details

    • create

      static RadiusResponse create​(Dictionary dictionary, byte type, byte identifier, byte[] authenticator, java.util.List<RadiusAttribute> attributes)
      Creates a RadiusPacket object. Depending on the passed type, an appropriate packet is created. Also sets the type, and the the packet identifier.
      Parameters:
      dictionary - custom dictionary to use
      type - packet type
      identifier - packet identifier
      authenticator - authenticator for packet, nullable
      attributes - list of attributes for packet
      Returns:
      RadiusPacket object
    • fromDatagram

      static RadiusResponse fromDatagram​(Dictionary dictionary, io.netty.channel.socket.DatagramPacket datagram) throws RadiusPacketException
      Reads a response from the given input stream and creates an appropriate RadiusPacket/subclass.

      Decodes the encrypted fields and attributes of the packet, and checks authenticator if appropriate.

      Parameters:
      dictionary - dictionary to use for attributes
      datagram - DatagramPacket to read packet from
      Returns:
      new RadiusPacket object
      Throws:
      RadiusPacketException - malformed packet
    • encodeResponse

      RadiusResponse encodeResponse​(java.lang.String sharedSecret, byte[] requestAuth) throws RadiusPacketException
      Encode and generate authenticator.

      Requires request authenticator to generate response authenticator.

      Must be idempotent.

      Parameters:
      sharedSecret - shared secret to be used to encode this packet
      requestAuth - request packet authenticator
      Returns:
      new RadiusPacket instance with same properties and valid authenticator
      Throws:
      RadiusPacketException - errors encoding packet
    • decodeResponse

      RadiusResponse decodeResponse​(java.lang.String sharedSecret, byte[] requestAuth) throws RadiusPacketException
      Decodes the response against the supplied shared secret and request authenticator.

      Must be idempotent.

      Parameters:
      sharedSecret - shared secret
      requestAuth - authenticator for corresponding request
      Returns:
      verified RadiusResponse with decoded attributes if appropriate
      Throws:
      RadiusPacketException - errors verifying or decoding packet