Package org.tinyradius.core.packet.util
Interface MessageAuthSupport<T extends RadiusPacket<T>>
- Type Parameters:
T
- same type as implementation
- All Superinterfaces:
AttributeHolder<T>
,NestedAttributeHolder<T>
,RadiusPacket<T>
- All Known Implementing Classes:
AccessRequest
,AccessRequestArap
,AccessRequestChap
,AccessRequestEap
,AccessRequestNoAuth
,AccessRequestPap
,AccessResponse
,AccessResponse.Accept
,AccessResponse.Challenge
,AccessResponse.Reject
Partial implementation for encoding/verifying Message-Authenticator (RFC 2869)
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final org.apache.logging.log4j.Logger
Fields inherited from interface org.tinyradius.core.attribute.AttributeHolder
attrHolderLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
calcMessageAuthInput
(RadiusPacket<?> packet, byte[] requestAuth) default byte[]
computeMessageAuth
(RadiusPacket<?> packet, String sharedSecret, byte[] requestAuth) default T
encodeMessageAuth
(String sharedSecret, byte[] requestAuth) Creates packet with an encoded Message-Authenticator attribute.static Mac
getHmacMd5
(String key) default void
verifyMessageAuth
(String sharedSecret, byte[] requestAuth) 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
-
Field Details
-
msgAuthLogger
static final org.apache.logging.log4j.Logger msgAuthLogger -
MESSAGE_AUTHENTICATOR
static final int MESSAGE_AUTHENTICATOR- See Also:
-
-
Method Details
-
calcMessageAuthInput
-
getHmacMd5
-
verifyMessageAuth
default void verifyMessageAuth(String sharedSecret, byte[] requestAuth) throws RadiusPacketException - Throws:
RadiusPacketException
-
computeMessageAuth
-
encodeMessageAuth
Creates packet with an encoded Message-Authenticator attribute.Note: 'this' packet authenticator is ignored, only requestAuth param is used.
- Parameters:
sharedSecret
- shared secretrequestAuth
- current packet auth if encoding request, otherwise corresponding request auth- Returns:
- encoded copy of packet
- Throws:
RadiusPacketException
- packet validation exceptions
-