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
public interface MessageAuthSupport<T extends RadiusPacket<T>> extends RadiusPacket<T>
Partial implementation for encoding/verifying Message-Authenticator (RFC 2869)
-
Field Summary
Fields Modifier and Type Field Description static int
MESSAGE_AUTHENTICATOR
static org.apache.logging.log4j.Logger
msgAuthLogger
Fields inherited from interface org.tinyradius.core.packet.RadiusPacket
HEADER_LENGTH, MAX_PACKET_LENGTH, packetLogger
-
Method Summary
Modifier and Type Method Description static byte[]
calcMessageAuthInput(RadiusPacket<?> packet, byte[] requestAuth)
default byte[]
computeMessageAuth(RadiusPacket<?> packet, java.lang.String sharedSecret, byte[] requestAuth)
default T
encodeMessageAuth(java.lang.String sharedSecret, byte[] requestAuth)
Creates packet with an encoded Message-Authenticator attribute.static javax.crypto.Mac
getHmacMd5(java.lang.String key)
default void
verifyMessageAuth(java.lang.String sharedSecret, byte[] requestAuth)
Methods inherited from interface org.tinyradius.core.attribute.AttributeHolder
addAttribute, addAttribute, decodeAttributes, encodeAttributes, filterAttributes, filterAttributes, filterAttributes, getAttribute, getAttribute, getAttributeBytes, getChildVendorId, removeAttributes, removeLastAttribute, withAttributes
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
-
Field Details
-
msgAuthLogger
static final org.apache.logging.log4j.Logger msgAuthLogger -
MESSAGE_AUTHENTICATOR
static final int MESSAGE_AUTHENTICATOR- See Also:
- Constant Field Values
-
-
Method Details
-
calcMessageAuthInput
-
getHmacMd5
static javax.crypto.Mac getHmacMd5(java.lang.String key) -
verifyMessageAuth
default void verifyMessageAuth(java.lang.String sharedSecret, byte[] requestAuth) throws RadiusPacketException- Throws:
RadiusPacketException
-
computeMessageAuth
default byte[] computeMessageAuth(RadiusPacket<?> packet, java.lang.String sharedSecret, byte[] requestAuth) -
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
-