Class MessageAuthenticatorAttribute
- java.lang.Object
-
- org.forgerock.openam.radius.common.Attribute
-
- org.forgerock.openam.radius.common.MessageAuthenticatorAttribute
-
public class MessageAuthenticatorAttribute extends Attribute
Represents the Message-Authenticator attribute (type 80) defined in section 3.2 of RFC 3579 (originally introduced by RFC 2869). The value is a 16-octet HMAC-MD5 of the entire RADIUS packet computed with the shared secret as the key, with the value field of this attribute being treated as 16 zero octets during the computation. For responses, the response authenticator field of the packet is replaced by the corresponding request authenticator during the HMAC computation as required by RFC 3579.
-
-
Field Summary
Fields Modifier and Type Field Description static intWIRE_LENGTHThe fixed length on the wire (type + length + 16 octets).-
Fields inherited from class org.forgerock.openam.radius.common.Attribute
MAX_ATTRIBUTE_LENGTH, MAX_ATTRIBUTE_VALUE_LENGTH
-
-
Constructor Summary
Constructors Constructor Description MessageAuthenticatorAttribute()Create an attribute initialized with 16 zero octets, suitable for inclusion in an outbound packet prior to HMAC-MD5 computation.MessageAuthenticatorAttribute(byte[] octets)Create an attribute from on-the-wire octets.MessageAuthenticatorAttribute(byte[] hmac, boolean copy)Create an attribute carrying the supplied 16-octet HMAC value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getHmac()Returns a copy of the 16-octet HMAC value carried by this attribute.StringtoStringImpl()Method expected to be overridden by subclasses to append detail beyond attribute type name.
-
-
-
Field Detail
-
WIRE_LENGTH
public static final int WIRE_LENGTH
The fixed length on the wire (type + length + 16 octets).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessageAuthenticatorAttribute
public MessageAuthenticatorAttribute()
Create an attribute initialized with 16 zero octets, suitable for inclusion in an outbound packet prior to HMAC-MD5 computation.
-
MessageAuthenticatorAttribute
public MessageAuthenticatorAttribute(byte[] octets)
Create an attribute from on-the-wire octets.- Parameters:
octets- the on-the-wire bytes including type and length prefix.
-
MessageAuthenticatorAttribute
public MessageAuthenticatorAttribute(byte[] hmac, boolean copy)Create an attribute carrying the supplied 16-octet HMAC value.- Parameters:
hmac- the 16-octet HMAC-MD5 value.
-
-
Method Detail
-
getHmac
public byte[] getHmac()
Returns a copy of the 16-octet HMAC value carried by this attribute.- Returns:
- the 16-octet HMAC-MD5 value.
-
toStringImpl
public String toStringImpl()
Description copied from class:AttributeMethod expected to be overridden by subclasses to append detail beyond attribute type name. Used by logging to portray attribute field structure when logging packet traffic if special handling is required for a given field distinct from that provided by the super class.- Overrides:
toStringImplin classAttribute- Returns:
- the string representation of this attribute which is an empty string by default.
-
-