Struct nucypher_core::MessageKit
source · [−]pub struct MessageKit {
pub capsule: Capsule,
/* private fields */
}Expand description
Encrypted message prepared for re-encryption.
Fields
capsule: CapsuleEncapsulated symmetric key for this message.
Implementations
sourceimpl MessageKit
impl MessageKit
sourcepub fn new(policy_encrypting_key: &PublicKey, plaintext: &[u8]) -> Self
pub fn new(policy_encrypting_key: &PublicKey, plaintext: &[u8]) -> 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,
cfrags: impl IntoIterator<Item = VerifiedCapsuleFrag>
) -> Result<Box<[u8]>, ReencryptionError>
pub fn decrypt_reencrypted(
&self,
sk: &SecretKey,
policy_encrypting_key: &PublicKey,
cfrags: impl IntoIterator<Item = VerifiedCapsuleFrag>
) -> Result<Box<[u8]>, ReencryptionError>
Decrypts the message using the Bob’s key and re-encrypted capsule frags.
Trait Implementations
sourceimpl Clone for MessageKit
impl Clone for MessageKit
sourcefn clone(&self) -> MessageKit
fn clone(&self) -> MessageKit
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 MessageKit
impl Debug for MessageKit
sourceimpl<'de> Deserialize<'de> for MessageKit
impl<'de> Deserialize<'de> for MessageKit
sourcefn 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
sourceimpl PartialEq<MessageKit> for MessageKit
impl PartialEq<MessageKit> for MessageKit
sourcefn 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 ==. Read more
sourcefn ne(&self, other: &MessageKit) -> bool
fn ne(&self, other: &MessageKit) -> bool
This method tests for !=.
sourceimpl<'a> ProtocolObject<'a> for MessageKit
impl<'a> ProtocolObject<'a> for MessageKit
sourceimpl Serialize for MessageKit
impl Serialize for MessageKit
impl StructuralPartialEq for MessageKit
Auto Trait Implementations
impl RefUnwindSafe for MessageKit
impl Send for MessageKit
impl Sync for MessageKit
impl Unpin for MessageKit
impl UnwindSafe for MessageKit
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more