Struct coset::CoseRecipient
source · pub struct CoseRecipient {
pub protected: ProtectedHeader,
pub unprotected: Header,
pub ciphertext: Option<Vec<u8>>,
pub recipients: Vec<CoseRecipient>,
}
Expand description
Structure representing the recipient of encrypted data.
COSE_Recipient = [
Headers,
ciphertext : bstr / nil,
? recipients : [+COSE_recipient]
]
Fields§
§protected: ProtectedHeader
§unprotected: Header
§ciphertext: Option<Vec<u8>>
§recipients: Vec<CoseRecipient>
Implementations§
source§impl CoseRecipient
impl CoseRecipient
sourcepub fn decrypt<F, E>(
&self,
context: EncryptionContext,
external_aad: &[u8],
cipher: F
) -> Result<Vec<u8>, E>
pub fn decrypt<F, E>( &self, context: EncryptionContext, external_aad: &[u8], cipher: F ) -> Result<Vec<u8>, E>
Decrypt the ciphertext
value with an AEAD, using cipher
to decrypt the cipher text and
combined AAD as per RFC 8152 section 5.3.
§Panics
This function will panic if no ciphertext
is available. It will also panic
if the context
parameter does not refer to a recipient context.
Trait Implementations§
source§impl AsCborValue for CoseRecipient
impl AsCborValue for CoseRecipient
source§impl CborSerializable for CoseRecipient
impl CborSerializable for CoseRecipient
source§fn from_slice(slice: &[u8]) -> Result<Self>
fn from_slice(slice: &[u8]) -> Result<Self>
Create an object instance from serialized CBOR data in a slice. This method will fail (with
CoseError::ExtraneousData
) if there is additional CBOR data after the object.source§impl Clone for CoseRecipient
impl Clone for CoseRecipient
source§fn clone(&self) -> CoseRecipient
fn clone(&self) -> CoseRecipient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CoseRecipient
impl Debug for CoseRecipient
source§impl Default for CoseRecipient
impl Default for CoseRecipient
source§fn default() -> CoseRecipient
fn default() -> CoseRecipient
Returns the “default value” for a type. Read more
source§impl PartialEq for CoseRecipient
impl PartialEq for CoseRecipient
source§fn eq(&self, other: &CoseRecipient) -> bool
fn eq(&self, other: &CoseRecipient) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CoseRecipient
Auto Trait Implementations§
impl Freeze for CoseRecipient
impl RefUnwindSafe for CoseRecipient
impl Send for CoseRecipient
impl Sync for CoseRecipient
impl Unpin for CoseRecipient
impl UnwindSafe for CoseRecipient
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