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