Enum stun_rs::attributes::stun::MessageIntegritySha256
source · [−]pub enum MessageIntegritySha256 {
Encodable(EncodableMessageIntegritySha256),
Decodable(DecodableMessageIntegritySha256),
}Expand description
The MessageIntegritySha256 attribute contains an HMAC-SHA256
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 = MessageIntegritySha256::new(key);
assert_eq!(attr.attribute_type(), AttributeType::from(0x001C));Variants
Encodable(EncodableMessageIntegritySha256)
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(DecodableMessageIntegritySha256)
Decodable version of this attribute. This is the decoded attribute received from the network.
Implementations
sourceimpl MessageIntegritySha256
impl MessageIntegritySha256
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 MessageIntegritySha256
impl Debug for MessageIntegritySha256
sourceimpl From<&[u8; 32]> for MessageIntegritySha256
impl From<&[u8; 32]> for MessageIntegritySha256
sourceimpl From<[u8; 32]> for MessageIntegritySha256
impl From<[u8; 32]> for MessageIntegritySha256
sourceimpl From<MessageIntegritySha256> for StunAttribute
impl From<MessageIntegritySha256> for StunAttribute
sourcefn from(value: MessageIntegritySha256) -> Self
fn from(value: MessageIntegritySha256) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<MessageIntegritySha256> for MessageIntegritySha256
impl PartialEq<MessageIntegritySha256> for MessageIntegritySha256
sourcefn eq(&self, other: &MessageIntegritySha256) -> bool
fn eq(&self, other: &MessageIntegritySha256) -> bool
sourceimpl StunAttributeType for MessageIntegritySha256
impl StunAttributeType for MessageIntegritySha256
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 MessageIntegritySha256
impl StructuralEq for MessageIntegritySha256
impl StructuralPartialEq for MessageIntegritySha256
Auto Trait Implementations
impl RefUnwindSafe for MessageIntegritySha256
impl !Send for MessageIntegritySha256
impl !Sync for MessageIntegritySha256
impl Unpin for MessageIntegritySha256
impl UnwindSafe for MessageIntegritySha256
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