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
sourceimpl CoseRecipient
impl CoseRecipient
sourcepub fn decrypt<F, E>(
&self,
context: EncryptionContext,
external_aad: &[u8],
cipher: F
) -> Result<Vec<u8>, E> where
F: FnOnce(&[u8], &[u8]) -> Result<Vec<u8>, E>,
pub fn decrypt<F, E>(
&self,
context: EncryptionContext,
external_aad: &[u8],
cipher: F
) -> Result<Vec<u8>, E> where
F: FnOnce(&[u8], &[u8]) -> Result<Vec<u8>, E>,
Decrypt the ciphertext
value, using cipher
to decrypt the cipher text and
combined AAD.
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
sourceimpl AsCborValue for CoseRecipient
impl AsCborValue for CoseRecipient
sourcefn from_cbor_value(value: Value) -> Result<Self>
fn from_cbor_value(value: Value) -> Result<Self>
Convert a Value
into an instance of the type.
sourcefn to_cbor_value(self) -> Result<Value>
fn to_cbor_value(self) -> Result<Value>
Convert the object into a Value
, consuming it along the way.
sourceimpl CborSerializable for CoseRecipient
impl CborSerializable for CoseRecipient
sourceimpl Clone for CoseRecipient
impl Clone for CoseRecipient
sourcefn clone(&self) -> CoseRecipient
fn clone(&self) -> CoseRecipient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CoseRecipient
impl Debug for CoseRecipient
sourceimpl Default for CoseRecipient
impl Default for CoseRecipient
sourcefn default() -> CoseRecipient
fn default() -> CoseRecipient
Returns the “default value” for a type. Read more
sourceimpl PartialEq<CoseRecipient> for CoseRecipient
impl PartialEq<CoseRecipient> for CoseRecipient
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &CoseRecipient) -> bool
fn ne(&self, other: &CoseRecipient) -> bool
This method tests for !=
.
impl StructuralPartialEq for CoseRecipient
Auto Trait Implementations
impl RefUnwindSafe for CoseRecipient
impl Send for CoseRecipient
impl Sync for CoseRecipient
impl Unpin for CoseRecipient
impl UnwindSafe for CoseRecipient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more