Struct coset::CoseMac0[][src]

pub struct CoseMac0 {
    pub protected: Header,
    pub unprotected: Header,
    pub payload: Option<Vec<u8>>,
    pub tag: Vec<u8>,
}
Expand description

Structure representing a message with authentication code (MAC) where the relevant key is implicit.

 COSE_Mac0 = [
    Headers,
    payload : bstr / nil,
    tag : bstr,
 ]

Fields

protected: Headerunprotected: Headerpayload: Option<Vec<u8>>tag: Vec<u8>

Implementations

Verify the tag value using the provided mac function, feeding it the tag value and the combined to-be-MACed data (in that order).

Panics

This function will panic if the payload has not been set.

Trait Implementations

Create an object instance by reading serialized CBOR data from std::io::Read instance.

Create an object instance from serialized CBOR data in a slice.

Serialize this object to a vector.

Serialize this object to a std::io::Write instance.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The associated tag value.

Create an object instance by reading serialized CBOR data from std::io::Read instance, expecting an initial tag value. Read more

Create an object instance from serialized CBOR data in a slice, expecting an initial tag value. Read more

Serialize this object to a vector, including initial tag.

Serialize this object to a std::io::Write instance, including initial tag.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.