Struct coset::CoseSign1Builder
source · pub struct CoseSign1Builder(/* private fields */);
Expand description
Builder for CoseSign1
objects.
Implementations§
source§impl CoseSign1Builder
impl CoseSign1Builder
sourcepub fn unprotected(self, unprotected: Header) -> Self
pub fn unprotected(self, unprotected: Header) -> Self
Set the associated field.
sourcepub fn create_signature<F>(self, aad: &[u8], signer: F) -> Self
pub fn create_signature<F>(self, aad: &[u8], signer: F) -> Self
Calculate the signature value, using signer
to generate the signature bytes. Any
protected header values should be set before using this method.
sourcepub fn create_detached_signature<F>(
self,
payload: &[u8],
aad: &[u8],
signer: F
) -> Self
pub fn create_detached_signature<F>( self, payload: &[u8], aad: &[u8], signer: F ) -> Self
Calculate the signature value for a detached payload, using signer
to generate the
signature bytes. Any protected header values should be set before using this method.
§Panics
This method will panic if self.payload.is_some()
.
sourcepub fn try_create_signature<F, E>(
self,
aad: &[u8],
signer: F
) -> Result<Self, E>
pub fn try_create_signature<F, E>( self, aad: &[u8], signer: F ) -> Result<Self, E>
Calculate the signature value, using signer
to generate the signature bytes. Any
protected header values should be set before using this method.
sourcepub fn try_create_detached_signature<F, E>(
self,
payload: &[u8],
aad: &[u8],
signer: F
) -> Result<Self, E>
pub fn try_create_detached_signature<F, E>( self, payload: &[u8], aad: &[u8], signer: F ) -> Result<Self, E>
Calculate the signature value for a detached payload, using signer
to generate the
signature bytes. Any protected header values should be set before using this method.
§Panics
This method will panic if self.payload.is_some()
.