pub struct PrivateKey { /* private fields */ }Implementations§
Source§impl PrivateKey
impl PrivateKey
pub fn generate() -> Result<PrivateKey, EllipticCurveError>
pub fn from_bytes(key: &[u8; 32]) -> Result<PrivateKey, EllipticCurveError>
pub fn public_key(&self) -> PublicKey
pub fn sign(&self, message: &[u8]) -> Result<[u8; 64], EllipticCurveError>
pub fn ecdh( &self, peer_public: &PublicKey, ) -> Result<[u8; 32], EllipticCurveError>
pub fn to_bytes(&self) -> [u8; 32]
Trait Implementations§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PrivateKey
Source§impl Debug for PrivateKey
impl Debug for PrivateKey
impl Eq for PrivateKey
Source§impl PartialEq for PrivateKey
impl PartialEq for PrivateKey
Source§fn eq(&self, other: &PrivateKey) -> bool
fn eq(&self, other: &PrivateKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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