Class AccessResponse
java.lang.Object
org.tinyradius.core.packet.BaseRadiusPacket<RadiusResponse>
org.tinyradius.core.packet.response.GenericResponse
org.tinyradius.core.packet.response.AccessResponse
- All Implemented Interfaces:
AttributeHolder<RadiusResponse>
,NestedAttributeHolder<RadiusResponse>
,RadiusPacket<RadiusResponse>
,RadiusResponse
,MessageAuthSupport<RadiusResponse>
- Direct Known Subclasses:
AccessResponse.Accept
,AccessResponse.Challenge
,AccessResponse.Reject
public class AccessResponse extends GenericResponse implements MessageAuthSupport<RadiusResponse>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessResponse.Accept
static class
AccessResponse.Challenge
static class
AccessResponse.Reject
-
Field Summary
Fields inherited from interface org.tinyradius.core.packet.util.MessageAuthSupport
MESSAGE_AUTHENTICATOR, msgAuthLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH, packetLogger
-
Method Summary
Modifier and Type Method Description RadiusResponse
decodeResponse(java.lang.String sharedSecret, byte[] requestAuth)
Decodes the response against the supplied shared secret and request authenticator.RadiusResponse
encodeResponse(java.lang.String sharedSecret, byte[] requestAuth)
Encode and generate authenticator.AccessResponse
withAttributes(java.util.List<RadiusAttribute> attributes)
Methods inherited from class org.tinyradius.core.packet.BaseRadiusPacket
equals, getAttributes, getAuthenticator, getChildVendorId, getDictionary, getId, getType, hashCode, toString
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, filterAttributes, filterAttributes, filterAttributes, getAttribute, getAttribute, getAttributeBytes, getChildVendorId, removeAttributes, removeLastAttribute
Methods inherited from interface org.tinyradius.core.packet.util.MessageAuthSupport
computeMessageAuth, encodeMessageAuth, verifyMessageAuth
Methods inherited from interface org.tinyradius.core.attribute.NestedAttributeHolder
addAttribute, filterAttributes, filterAttributes, getAttribute, getFlattenedAttributes, getVendorAttributes, removeAttribute, removeAttributes
Methods inherited from interface org.tinyradius.core.packet.RadiusPacket
genHashedAuth, getAttributes, getAuthenticator, getDictionary, getId, getType, toDatagram, toDatagram, verifyPacketAuth
-
Method Details
-
encodeResponse
public RadiusResponse encodeResponse(java.lang.String sharedSecret, byte[] requestAuth) throws RadiusPacketExceptionDescription copied from interface:RadiusResponse
Encode and generate authenticator.Requires request authenticator to generate response authenticator.
Must be idempotent.
- Specified by:
encodeResponse
in interfaceRadiusResponse
- Overrides:
encodeResponse
in classGenericResponse
- 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(java.lang.String sharedSecret, byte[] requestAuth) throws RadiusPacketExceptionDescription copied from interface:RadiusResponse
Decodes the response against the supplied shared secret and request authenticator.Must be idempotent.
- Specified by:
decodeResponse
in interfaceRadiusResponse
- Overrides:
decodeResponse
in classGenericResponse
- Parameters:
sharedSecret
- shared secretrequestAuth
- authenticator for corresponding request- Returns:
- verified RadiusResponse with decoded attributes if appropriate
- Throws:
RadiusPacketException
- errors verifying or decoding packet
-
withAttributes
- Specified by:
withAttributes
in interfaceAttributeHolder<RadiusResponse>
- Overrides:
withAttributes
in classGenericResponse
-