pub struct PublicKey { /* private fields */ }Expand description
X25519 Diffie-Hellman key exchange public key (RFC 7748).
§Deserializing from bytes
ⓘ
use crypto::curve25519::x25519::PublicKey;
let bytes = [0u8; 32]; // replace with a peer's public key
let pub_key = PublicKey::from_bytes(&bytes);§Conversion from Ed25519
An Ed25519 PublicKey can be
converted to an X25519 public key via TryFrom<&ed25519::PublicKey>.
Implementations§
Trait Implementations§
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
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