Struct coset::CoseEncrypt0Builder
source · pub struct CoseEncrypt0Builder(/* private fields */);
Expand description
Builder for CoseEncrypt0
objects.
Implementations§
source§impl CoseEncrypt0Builder
impl CoseEncrypt0Builder
sourcepub fn build(self) -> CoseEncrypt0
pub fn build(self) -> CoseEncrypt0
Build the completed object.
sourcepub fn unprotected(self, unprotected: Header) -> Self
pub fn unprotected(self, unprotected: Header) -> Self
Set the associated field.
sourcepub fn ciphertext(self, ciphertext: Vec<u8>) -> Self
pub fn ciphertext(self, ciphertext: Vec<u8>) -> Self
Set the associated field.
sourcepub fn create_ciphertext<F>(
self,
plaintext: &[u8],
external_aad: &[u8],
cipher: F
) -> Self
pub fn create_ciphertext<F>( self, plaintext: &[u8], external_aad: &[u8], cipher: F ) -> Self
Calculate the ciphertext value with an AEAD, using cipher
to generate the encrypted bytes
from the plaintext and combined AAD (in that order) as per RFC 8152 section 5.3. Any
protected header values should be set before using this method.
sourcepub fn try_create_ciphertext<F, E>(
self,
plaintext: &[u8],
external_aad: &[u8],
cipher: F
) -> Result<Self, E>
pub fn try_create_ciphertext<F, E>( self, plaintext: &[u8], external_aad: &[u8], cipher: F ) -> Result<Self, E>
Calculate the ciphertext value with an AEAD, using cipher
to generate the encrypted bytes
from the plaintext and combined AAD (in that order) as per RFC 8152 section 5.3. Any
protected header values should be set before using this method.
Trait Implementations§
source§impl Debug for CoseEncrypt0Builder
impl Debug for CoseEncrypt0Builder
source§impl Default for CoseEncrypt0Builder
impl Default for CoseEncrypt0Builder
source§fn default() -> CoseEncrypt0Builder
fn default() -> CoseEncrypt0Builder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CoseEncrypt0Builder
impl RefUnwindSafe for CoseEncrypt0Builder
impl Send for CoseEncrypt0Builder
impl Sync for CoseEncrypt0Builder
impl Unpin for CoseEncrypt0Builder
impl UnwindSafe for CoseEncrypt0Builder
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