Struct keynesis::key::ed25519::SecretKey [−][src]
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: Rng) -> Self where
Rng: RngCore + CryptoRng,
[src]
Rng: RngCore + CryptoRng,
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.
Trait Implementations
impl Clone for SecretKey
[src]
impl Debug for SecretKey
[src]
conveniently provide an incomplete implementation of Debug for the SecretKey.
impl Dh for SecretKey
[src]
fn name() -> &'static str
[src]
fn generate<RNG>(rng: &mut RNG) -> Self where
RNG: RngCore + CryptoRng,
[src]
RNG: RngCore + CryptoRng,
fn public(&self) -> PublicKey
[src]
fn dh(&self, public: &PublicKey) -> SharedSecret
[src]
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for SecretKey
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SecretKey> for SecretKey
[src]
impl<'a> TryFrom<&'a [u8]> for SecretKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,