pub struct KeyPair { /* private fields */ }Expand description
A struct representing a Curve25519 key pair (public and private).
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn new(public: Key, private: Key) -> Self
pub fn new(public: Key, private: Key) -> Self
Creates a new KeyPair with the supplied public and private keys.
Sourcepub fn generate() -> Result<Self>
pub fn generate() -> Result<Self>
Generates a new KeyPair using a randomly generated private key.
Sourcepub fn public_key(&self) -> String
pub fn public_key(&self) -> String
Returns the hex encoded public key.
Sourcepub fn private_key(&self) -> String
pub fn private_key(&self) -> String
Returns the hex encoded private key.
Trait Implementations§
impl Eq for KeyPair
impl StructuralPartialEq for KeyPair
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.