Struct coset::CoseMacBuilder
source · pub struct CoseMacBuilder(/* private fields */);
Expand description
Builder for CoseMac
objects.
Implementations§
source§impl CoseMacBuilder
impl CoseMacBuilder
sourcepub fn unprotected(self, unprotected: Header) -> Self
pub fn unprotected(self, unprotected: Header) -> Self
Set the associated field.
sourcepub fn add_recipient(self, recipient: CoseRecipient) -> Self
pub fn add_recipient(self, recipient: CoseRecipient) -> Self
Add a CoseRecipient
.
sourcepub fn create_tag<F>(self, external_aad: &[u8], create: F) -> Self
pub fn create_tag<F>(self, external_aad: &[u8], create: F) -> Self
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>
pub fn try_create_tag<F, E>( self, external_aad: &[u8], create: F ) -> Result<Self, 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 CoseMacBuilder
impl Debug for CoseMacBuilder
source§impl Default for CoseMacBuilder
impl Default for CoseMacBuilder
source§fn default() -> CoseMacBuilder
fn default() -> CoseMacBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CoseMacBuilder
impl RefUnwindSafe for CoseMacBuilder
impl Send for CoseMacBuilder
impl Sync for CoseMacBuilder
impl Unpin for CoseMacBuilder
impl UnwindSafe for CoseMacBuilder
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