pub struct PrivateKey(pub [u8; 32]);Expand description
An X25519 private key (a 32-byte string).
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl PrivateKey
impl PrivateKey
Derive the shared key between this private key and a peer’s public key. Don’t use the shared key directly, rather use a KDF and also include the two public values as inputs.
Will fail and produce None if the peer’s public key is a point of
small order. It is safe to react to this in non-constant time.
Sourcepub fn generate() -> (PublicKey, PrivateKey)
pub fn generate() -> (PublicKey, PrivateKey)
Generate a new key pair.
Trait Implementations§
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