Struct coset::CoseEncryptBuilder
source · pub struct CoseEncryptBuilder(/* private fields */);
Expand description
Builder for CoseEncrypt
objects.
Implementations§
source§impl CoseEncryptBuilder
impl CoseEncryptBuilder
sourcepub fn build(self) -> CoseEncrypt
pub fn build(self) -> CoseEncrypt
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.
sourcepub fn add_recipient(self, recipient: CoseRecipient) -> Self
pub fn add_recipient(self, recipient: CoseRecipient) -> Self
Add a CoseRecipient
.
Trait Implementations§
source§impl Debug for CoseEncryptBuilder
impl Debug for CoseEncryptBuilder
source§impl Default for CoseEncryptBuilder
impl Default for CoseEncryptBuilder
source§fn default() -> CoseEncryptBuilder
fn default() -> CoseEncryptBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CoseEncryptBuilder
impl RefUnwindSafe for CoseEncryptBuilder
impl Send for CoseEncryptBuilder
impl Sync for CoseEncryptBuilder
impl Unpin for CoseEncryptBuilder
impl UnwindSafe for CoseEncryptBuilder
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