SecretKey

Struct SecretKey 

Source
pub struct SecretKey(/* private fields */);

Implementations§

Source§

impl SecretKey

Source

pub fn to_ed25519_bytes(&self) -> Vec<u8>

Convert this SecretKey into an array of 64 bytes, corresponding to an Ed25519 expanded secret key.

Trait Implementations§

Source§

impl Blind for SecretKey

Source§

type E = KeyPairError

Source§

fn blind(&mut self, blinding_factor: &[u8]) -> Result<(), Self::E>

Perform a blinding operation on the key with the given blinding factor.
Source§

fn to_blind(&self, blinding_factor: &[u8]) -> Result<Self, Self::E>
where Self: Sized,

Perform a blinding operation on the key with the given blinding factor.
Source§

impl Clone for SecretKey

Source§

fn clone(&self) -> SecretKey

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SecretKey

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DiffieHellman for SecretKey

Source§

type SSK = SharedSecret

Source§

type PK = PublicKey

Source§

fn diffie_hellman(&self, peer_public: &Self::PK) -> Self::SSK

Derives SharedSecretKey from the other PublicKey
Source§

impl From<&SecretKey> for EphemeralSecretKey

Source§

fn from(sk: &SecretKey) -> Self

Converts to this type from the input type.
Source§

impl From<EphemeralSecretKey> for SecretKey

Source§

fn from(esk: EphemeralSecretKey) -> Self

Converts to this type from the input type.
Source§

impl From<SecretKey> for EphemeralSecretKey

Source§

fn from(sk: SecretKey) -> Self

Converts to this type from the input type.
Source§

impl FromBytes for SecretKey

Source§

type E = KeyPairError

Source§

fn from_bytes(bytes: &[u8]) -> Result<Self, Self::E>
where Self: Sized,

Construct a value from a slice of bytes.
Source§

impl FromEntropy for SecretKey

Source§

type E = KeyPairError

Source§

fn from_entropy(entropy: &[u8]) -> Result<Self, Self::E>
where Self: Sized,

Construct a value from user-provided entropy. Read more
Source§

impl Generate for SecretKey

Source§

fn generate_with<R: CryptoRng + RngCore>(csprng: R) -> Self
where Self: Sized,

Generates an “unbiased” SecretKey directly from a user suplied csprng uniformly.
Source§

fn generate() -> Self

Generate an “unbiased” SecretKey;
Source§

impl Len for SecretKey

Source§

const LEN: usize = 64usize

Source§

impl PartialEq for SecretKey

Source§

fn eq(&self, other: &SecretKey) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SecretKey for SecretKey

Source§

type PK = PublicKey

Source§

fn to_public(&self) -> Self::PK

Derives the PublicKey corresponding to this SecretKey.
Source§

impl Sign for SecretKey

Source§

type SIG = Signature

Source§

fn sign(&self, data: &[u8]) -> Self::SIG
where Self: Sized,

Sign a message.
Source§

impl ToVec for SecretKey

Source§

fn to_vec(&self) -> Vec<u8>
where Self: Sized,

Convert a key into a vec of bytes.
Source§

impl WithPhrase for SecretKey

Source§

type E = KeyPairError

Source§

fn from_phrase<'a, S: Into<Cow<'a, str>>>( s: S, password: Option<&str>, ) -> Result<Self, Self::E>
where Self: Sized,

Construct a value from mnemonic phrase and optional password.
Source§

fn generate_with_phrase( word_count: usize, password: Option<&str>, ) -> Result<(Self, String), Self::E>
where Self: Sized,

Generate a new value of word_count words and optional password. Read more
Source§

fn generate_in_with<R>( csprng: &mut R, word_count: usize, password: Option<&str>, ) -> Result<(Self, String), Self::E>
where Self: Sized, R: RngCore + CryptoRng,

Generate a new value of word_count words and optional password witn rng PRF. Read more
Source§

impl Zeroize for SecretKey

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl StructuralPartialEq for SecretKey

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V