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: Vec<(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: Vec<(Label, Value)>
Any additional header (label,value) pairs. If duplicate labels are present, CBOR-encoding will fail.
Implementations§
Trait Implementations§
source§impl AsCborValue for Header
impl AsCborValue for Header
source§impl CborSerializable for Header
impl CborSerializable for Header
source§fn from_slice(slice: &[u8]) -> Result<Self>
fn from_slice(slice: &[u8]) -> Result<Self>
Create an object instance from serialized CBOR data in a slice. This method will fail (with
CoseError::ExtraneousData
) if there is additional CBOR data after the object.source§impl PartialEq for Header
impl PartialEq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more