pub struct MessageKit {
pub capsule: Capsule,
pub conditions: Option<Conditions>,
/* private fields */
}
Expand description
Encrypted message prepared for re-encryption.
Fields§
§capsule: Capsule
Encapsulated symmetric key for this message.
conditions: Option<Conditions>
Decryption conditions for this message.
Implementations§
Source§impl MessageKit
impl MessageKit
Sourcepub fn new(
policy_encrypting_key: &PublicKey,
plaintext: &[u8],
conditions: Option<&Conditions>,
) -> Self
pub fn new( policy_encrypting_key: &PublicKey, plaintext: &[u8], conditions: Option<&Conditions>, ) -> Self
Creates a new encrypted message for the given policy key.
Sourcepub fn decrypt(&self, sk: &SecretKey) -> Result<Box<[u8]>, DecryptionError>
pub fn decrypt(&self, sk: &SecretKey) -> Result<Box<[u8]>, DecryptionError>
Decrypts the message using the original (Alice’s) key.
Sourcepub fn decrypt_reencrypted(
&self,
sk: &SecretKey,
policy_encrypting_key: &PublicKey,
vcfrags: impl IntoIterator<Item = VerifiedCapsuleFrag>,
) -> Result<Box<[u8]>, ReencryptionError>
pub fn decrypt_reencrypted( &self, sk: &SecretKey, policy_encrypting_key: &PublicKey, vcfrags: impl IntoIterator<Item = VerifiedCapsuleFrag>, ) -> Result<Box<[u8]>, ReencryptionError>
Decrypts the message using the Bob’s key and re-encrypted capsule frags.
Trait Implementations§
Source§impl Clone for MessageKit
impl Clone for MessageKit
Source§fn clone(&self) -> MessageKit
fn clone(&self) -> MessageKit
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 MessageKit
impl Debug for MessageKit
Source§impl<'de> Deserialize<'de> for MessageKit
impl<'de> Deserialize<'de> for MessageKit
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MessageKit
impl PartialEq for MessageKit
Source§impl<'a> ProtocolObject<'a> for MessageKit
impl<'a> ProtocolObject<'a> for MessageKit
Source§impl Serialize for MessageKit
impl Serialize for MessageKit
impl StructuralPartialEq for MessageKit
Auto Trait Implementations§
impl Freeze for MessageKit
impl RefUnwindSafe for MessageKit
impl Send for MessageKit
impl Sync for MessageKit
impl Unpin for MessageKit
impl UnwindSafe for MessageKit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromBytes for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBytes for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more