Struct nucypher_core::MessageKit
source · pub struct MessageKit {
pub capsule: Capsule,
pub conditions: Option<Conditions>,
/* private fields */
}Expand description
Encrypted message prepared for re-encryption.
Fields§
§capsule: CapsuleEncapsulated 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<MessageKit> for MessageKit
impl PartialEq<MessageKit> for MessageKit
source§fn eq(&self, other: &MessageKit) -> bool
fn eq(&self, other: &MessageKit) -> bool
This method tests for
self and other values to be equal, and is used
by ==.