Struct coset::CoseMac0Builder
source · pub struct CoseMac0Builder(_);
Expand description
Builder for CoseMac0
objects.
Implementations§
source§impl CoseMac0Builder
impl CoseMac0Builder
sourcepub fn unprotected(self, unprotected: Header) -> Self
pub fn unprotected(self, unprotected: Header) -> Self
Set the associated field.
sourcepub fn create_tag<F>(self, external_aad: &[u8], create: F) -> Selfwhere
F: FnOnce(&[u8]) -> Vec<u8>,
pub fn create_tag<F>(self, external_aad: &[u8], create: F) -> Selfwhere F: FnOnce(&[u8]) -> Vec<u8>,
Calculate the tag value, using mac
. Any protected header values should be set
before using this method, as should the payload
.
Panics
This function will panic if the payload
has not been set.
sourcepub fn try_create_tag<F, E>(
self,
external_aad: &[u8],
create: F
) -> Result<Self, E>where
F: FnOnce(&[u8]) -> Result<Vec<u8>, E>,
pub fn try_create_tag<F, E>( self, external_aad: &[u8], create: F ) -> Result<Self, E>where F: FnOnce(&[u8]) -> Result<Vec<u8>, E>,
Calculate the tag value, using mac
. Any protected header values should be set
before using this method, as should the payload
.
Panics
This function will panic if the payload
has not been set.
Trait Implementations§
source§impl Debug for CoseMac0Builder
impl Debug for CoseMac0Builder
source§impl Default for CoseMac0Builder
impl Default for CoseMac0Builder
source§fn default() -> CoseMac0Builder
fn default() -> CoseMac0Builder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for CoseMac0Builder
impl Send for CoseMac0Builder
impl Sync for CoseMac0Builder
impl Unpin for CoseMac0Builder
impl UnwindSafe for CoseMac0Builder
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