Struct vodozemac::pk_encryption::PkEncryption
source · pub struct PkEncryption { /* private fields */ }
Expand description
The encryption component of PkEncryption support.
This struct can be created from a Curve25519PublicKey
corresponding to
a PkDecryption
object, allowing encryption of messages for that object.
Implementations§
source§impl PkEncryption
impl PkEncryption
sourcepub const fn from_key(public_key: Curve25519PublicKey) -> Self
pub const fn from_key(public_key: Curve25519PublicKey) -> Self
Create a new PkEncryption
object from a Curve25519PublicKey
.
The public key should be obtained from an existing PkDecryption
object.
sourcepub fn encrypt(&self, message: &[u8]) -> Message
pub fn encrypt(&self, message: &[u8]) -> Message
Encrypt a message using this PkEncryption
object.
Trait Implementations§
source§impl From<&PkDecryption> for PkEncryption
impl From<&PkDecryption> for PkEncryption
source§fn from(value: &PkDecryption) -> Self
fn from(value: &PkDecryption) -> Self
Converts to this type from the input type.
source§impl From<Curve25519PublicKey> for PkEncryption
impl From<Curve25519PublicKey> for PkEncryption
source§fn from(public_key: Curve25519PublicKey) -> Self
fn from(public_key: Curve25519PublicKey) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PkEncryption
impl RefUnwindSafe for PkEncryption
impl Send for PkEncryption
impl Sync for PkEncryption
impl Unpin for PkEncryption
impl UnwindSafe for PkEncryption
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