pub enum MessageIntegrity {
    Encodable(EncodableMessageIntegrity),
    Decodable(DecodableMessageIntegrity),
}
Expand description

The MessageIntegrity attribute contains an HMAC-SHA1 RFC2104 of the STUN message. This attribute can be present in any STUN message type.

Examples

 // use short-term-credentials to generate the key
 let key = HMACKey::new_short_term("foo bar")?;
 let attr = MessageIntegrity::new(key);
 assert_eq!(attr.attribute_type(), AttributeType::from(0x0008));

Variants

Encodable(EncodableMessageIntegrity)

Encodable version of this attribute. This is used when the attribute is added to a STUN message that is going to be sent to the network.

Decodable(DecodableMessageIntegrity)

Decodable version of this attribute. This is the decoded attribute received from the network.

Implementations

Creates a new attribute.

Arguments:
  • key - The key used for the HMAC depends on which credential mechanism is in use.

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Returns the STUN attribute type.
Returns the STUN attribute type of this instance.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.