Class GenericResponse
java.lang.Object
org.tinyradius.core.packet.BaseRadiusPacket<RadiusResponse>
org.tinyradius.core.packet.response.GenericResponse
- All Implemented Interfaces:
AttributeHolder<RadiusResponse>
,NestedAttributeHolder<RadiusResponse>
,RadiusPacket<RadiusResponse>
,RadiusResponse
- Direct Known Subclasses:
AccessResponse
-
Field Summary
Fields inherited from interface org.tinyradius.core.attribute.AttributeHolder
attrHolderLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionGenericResponse
(Dictionary dictionary, io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) -
Method Summary
Modifier and TypeMethodDescriptiondecodeResponse
(String sharedSecret, byte[] requestAuth) Decodes the response against the supplied shared secret and request authenticator.encodeResponse
(String sharedSecret, byte[] requestAuth) Encode and generate authenticator.protected RadiusResponse
with
(io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) Naive with(), does not recalculate packet lengths in header.Methods inherited from class org.tinyradius.core.packet.BaseRadiusPacket
equals, getAttributes, getAuthenticator, getChildVendorId, getDictionary, getHeader, getId, getType, hashCode, toString, verifyPacketAuth, withAttributes, withAuthAttributes
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tinyradius.core.attribute.AttributeHolder
addAttribute, addAttribute, decodeAttributes, encodeAttributes, getAttribute, getAttribute, getAttributeByteBuf, getAttributes, getAttributes, getAttributes, getAttributes, getChildVendorId, getDictionary, removeAttributes, removeLastAttribute, withAttributes
Methods inherited from interface org.tinyradius.core.attribute.NestedAttributeHolder
addAttribute, getAttribute, getAttributes, getAttributes, getFlattenedAttributes, getVendorAttributes, removeAttribute, removeAttributes
Methods inherited from interface org.tinyradius.core.packet.RadiusPacket
genHashedAuth, getAuthenticator, getHeader, getId, getLength, getType, toByteBuf, toByteBuffer, toBytes
-
Constructor Details
-
GenericResponse
public GenericResponse(Dictionary dictionary, io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) throws RadiusPacketException - Throws:
RadiusPacketException
-
-
Method Details
-
encodeResponse
public RadiusResponse encodeResponse(String sharedSecret, byte[] requestAuth) throws RadiusPacketException Description copied from interface:RadiusResponse
Encode and generate authenticator.Requires request authenticator to generate response authenticator.
Must be idempotent.
- Specified by:
encodeResponse
in interfaceRadiusResponse
- Parameters:
sharedSecret
- shared secret to be used to encode this packetrequestAuth
- request packet authenticator- Returns:
- new RadiusPacket instance with same properties and valid authenticator
- Throws:
RadiusPacketException
- errors encoding packet
-
decodeResponse
public RadiusResponse decodeResponse(String sharedSecret, byte[] requestAuth) throws RadiusPacketException Description copied from interface:RadiusResponse
Decodes the response against the supplied shared secret and request authenticator.Must be idempotent.
- Specified by:
decodeResponse
in interfaceRadiusResponse
- Parameters:
sharedSecret
- shared secretrequestAuth
- authenticator for corresponding request- Returns:
- verified RadiusResponse with decoded attributes if appropriate
- Throws:
RadiusPacketException
- errors verifying or decoding packet
-
with
protected RadiusResponse with(io.netty.buffer.ByteBuf header, List<RadiusAttribute> attributes) throws RadiusPacketException Description copied from class:BaseRadiusPacket
Naive with(), does not recalculate packet lengths in header.- Specified by:
with
in classBaseRadiusPacket<RadiusResponse>
- Parameters:
header
- Radius packet headerattributes
- Radius packet attributes- Returns:
- RadiusPacket with the specified headers and attributes
- Throws:
RadiusPacketException
- packet validation exceptions
-