[][src]Struct keynesis::key::ed25519::SecretKey

pub struct SecretKey(_);

Ed25519 Secret Key

Mind it though, losing this key means losing control over your identity

Implementations

impl SecretKey[src]

pub const SIZE: usize[src]

the size of the Secret key in bytes

pub fn new<Rng>(rng: &mut Rng) -> Self where
    Rng: RngCore + CryptoRng
[src]

generate a new SecretKey with the given random number generator

pub fn exchange(&self, public_key: &PublicKey) -> SharedSecret[src]

generate a shared secret between the owner of the given public key and ourselves.

pub fn public_key(&self) -> PublicKey[src]

get the PublicKey associated to this key

Unlike the SecretKey, the PublicKey can be safely publicly shared. The key can then be used to verify any Signature generated with this SecretKey and the original message.

pub fn sign<T: AsRef<[u8]>>(&self, msg: T) -> Signature[src]

create a Signature for the given message with this SecretKey.

The Signature can then be verified against the associated PublicKey and the original message.

pub fn leak_as_ref(&self) -> &[u8; 32][src]

get a reference to the inner Seed bytes

Security Consideration

be mindful that leaking the content of the internal signing key may result in losing the ultimate control of the signing key

pub fn leak_to_hex(&self) -> String[src]

Trait Implementations

impl Clone for SecretKey[src]

impl Debug for SecretKey[src]

conveniently provide an incomplete implementation of Debug for the SecretKey.

impl Drop for SecretKey[src]

custom implementation of Drop so we can have more certainty that the secret key raw data will be scrubbed (zeroed) before releasing the memory

impl Eq for SecretKey[src]

impl From<[u8; 32]> for SecretKey[src]

impl FromStr for SecretKey[src]

type Err = FromHexError

The associated error which can be returned from parsing.

impl Hash for SecretKey[src]

impl PartialEq<SecretKey> for SecretKey[src]

impl<'a> TryFrom<&'a [u8]> for SecretKey[src]

type Error = SecretKeyError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,