Struct coset::Header[][src]

pub struct Header {
    pub alg: Option<Algorithm>,
    pub crit: Vec<RegisteredLabel<HeaderParameter>>,
    pub content_type: Option<ContentType>,
    pub key_id: Vec<u8>,
    pub iv: Vec<u8>,
    pub partial_iv: Vec<u8>,
    pub counter_signatures: Vec<CoseSignature>,
    pub rest: BTreeMap<Label, Value>,
}
Expand description

Structure representing a common COSE header map.

  header_map = {
      Generic_Headers,
      * label => values
  }

  Generic_Headers = (
      ? 1 => int / tstr,  ; algorithm identifier
      ? 2 => [+label],    ; criticality
      ? 3 => tstr / int,  ; content type
      ? 4 => bstr,        ; key identifier
      ? 5 => bstr,        ; IV
      ? 6 => bstr,        ; Partial IV
      ? 7 => COSE_Signature / [+COSE_Signature] ; Counter signature
  )

Fields

alg: Option<Algorithm>

Cryptographic algorithm to use

crit: Vec<RegisteredLabel<HeaderParameter>>

Critical headers to be understood

content_type: Option<ContentType>

Content type of the payload

key_id: Vec<u8>

Key identifier.

iv: Vec<u8>

Full initialization vector

partial_iv: Vec<u8>

Partial initialization vector

counter_signatures: Vec<CoseSignature>

Counter signature

rest: BTreeMap<Label, Value>

Any additional header values.

Implementations

Constructor from a cbor::Value that holds a bstr encoded header.

Convert this header to a bstr encoded map, as a cbor::Value.

Indicate whether the Header is empty.

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

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.