Enum stun_rs::attributes::stun::MessageIntegrity
source · [−]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
sourceimpl MessageIntegrity
impl MessageIntegrity
sourcepub fn new(key: HMACKey) -> Self
pub fn new(key: HMACKey) -> Self
Creates a new attribute.
Arguments:
key- The key used for theHMACdepends on which credential mechanism is in use.
Trait Implementations
sourceimpl Debug for MessageIntegrity
impl Debug for MessageIntegrity
sourceimpl From<&[u8; 20]> for MessageIntegrity
impl From<&[u8; 20]> for MessageIntegrity
sourceimpl From<[u8; 20]> for MessageIntegrity
impl From<[u8; 20]> for MessageIntegrity
sourceimpl From<MessageIntegrity> for StunAttribute
impl From<MessageIntegrity> for StunAttribute
sourcefn from(value: MessageIntegrity) -> Self
fn from(value: MessageIntegrity) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<MessageIntegrity> for MessageIntegrity
impl PartialEq<MessageIntegrity> for MessageIntegrity
sourcefn eq(&self, other: &MessageIntegrity) -> bool
fn eq(&self, other: &MessageIntegrity) -> bool
sourceimpl StunAttributeType for MessageIntegrity
impl StunAttributeType for MessageIntegrity
sourcefn get_type() -> AttributeTypewhere
Self: Sized,
fn get_type() -> AttributeTypewhere
Self: Sized,
Returns the STUN attribute type.
sourcefn attribute_type(&self) -> AttributeType
fn attribute_type(&self) -> AttributeType
Returns the STUN attribute type of this instance.
impl Eq for MessageIntegrity
impl StructuralEq for MessageIntegrity
impl StructuralPartialEq for MessageIntegrity
Auto Trait Implementations
impl RefUnwindSafe for MessageIntegrity
impl !Send for MessageIntegrity
impl !Sync for MessageIntegrity
impl Unpin for MessageIntegrity
impl UnwindSafe for MessageIntegrity
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more