pub struct SealedMessage { /* private fields */ }Expand description
A sealed message can be sent to anyone, but only the intended recipient can decrypt it.
Implementations§
Source§impl SealedMessage
impl SealedMessage
Sourcepub fn new(plaintext: impl Into<Vec<u8>>, recipient: &dyn Encrypter) -> Self
pub fn new(plaintext: impl Into<Vec<u8>>, recipient: &dyn Encrypter) -> Self
Creates a new SealedMessage from the given plaintext and recipient.
Sourcepub fn new_with_aad(
plaintext: impl Into<Vec<u8>>,
recipient: &dyn Encrypter,
aad: Option<impl Into<Vec<u8>>>,
) -> Self
pub fn new_with_aad( plaintext: impl Into<Vec<u8>>, recipient: &dyn Encrypter, aad: Option<impl Into<Vec<u8>>>, ) -> Self
Creates a new SealedMessage from the given plaintext, recipient, and
additional authenticated data.
Sourcepub fn new_opt(
plaintext: impl Into<Vec<u8>>,
recipient: &dyn Encrypter,
aad: Option<impl Into<Vec<u8>>>,
test_key_material: Option<impl Into<Vec<u8>>>,
test_nonce: Option<impl AsRef<Nonce>>,
) -> Self
pub fn new_opt( plaintext: impl Into<Vec<u8>>, recipient: &dyn Encrypter, aad: Option<impl Into<Vec<u8>>>, test_key_material: Option<impl Into<Vec<u8>>>, test_nonce: Option<impl AsRef<Nonce>>, ) -> Self
Creates a new SealedMessage from the given plaintext, recipient, and
additional authenticated data. Also accepts optional test key material
and test nonce.
Trait Implementations§
Source§impl AsRef<SealedMessage> for SealedMessage
impl AsRef<SealedMessage> for SealedMessage
Source§fn as_ref(&self) -> &SealedMessage
fn as_ref(&self) -> &SealedMessage
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl CBORTagged for SealedMessage
impl CBORTagged for SealedMessage
The CBOR tags assocated with this type. If more than one tag is present,
they are considered equivalent for reading, but only the first one is
used for writing.
Source§impl CBORTaggedDecodable for SealedMessage
impl CBORTaggedDecodable for SealedMessage
Source§fn from_untagged_cbor(cbor: CBOR) -> Result<Self>
fn from_untagged_cbor(cbor: CBOR) -> Result<Self>
Creates an instance of this type by decoding it from untagged CBOR.
Source§fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
fn from_tagged_cbor(cbor: CBOR) -> Result<Self, Error>where
Self: Sized,
Creates an instance of this type by decoding it from tagged CBOR.
Source§impl CBORTaggedEncodable for SealedMessage
impl CBORTaggedEncodable for SealedMessage
Source§fn untagged_cbor(&self) -> CBOR
fn untagged_cbor(&self) -> CBOR
Returns the untagged CBOR encoding of this instance.
Source§fn tagged_cbor(&self) -> CBOR
fn tagged_cbor(&self) -> CBOR
Returns the tagged CBOR encoding of this instance.
Source§impl Clone for SealedMessage
impl Clone for SealedMessage
Source§fn clone(&self) -> SealedMessage
fn clone(&self) -> SealedMessage
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 SealedMessage
impl Debug for SealedMessage
Source§impl From<SealedMessage> for CBOR
impl From<SealedMessage> for CBOR
Source§fn from(value: SealedMessage) -> Self
fn from(value: SealedMessage) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SealedMessage
impl PartialEq for SealedMessage
Source§impl TryFrom<CBOR> for SealedMessage
impl TryFrom<CBOR> for SealedMessage
impl Eq for SealedMessage
impl StructuralPartialEq for SealedMessage
Auto Trait Implementations§
impl Freeze for SealedMessage
impl RefUnwindSafe for SealedMessage
impl Send for SealedMessage
impl Sync for SealedMessage
impl Unpin for SealedMessage
impl UnwindSafe for SealedMessage
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