[−][src]Struct ecdsa::SecretKey
Secret keys for Weierstrass curves: wrapper around scalar values used as secret keys.
Prevents accidental exposure and handles zeroization.
Methods
impl<C> SecretKey<C> where
C: Curve,
[src]
C: Curve,
pub fn new(
into_bytes: impl Into<GenericArray<u8, <C as Curve>::ScalarSize>>
) -> SecretKey<C>
[src]
into_bytes: impl Into<GenericArray<u8, <C as Curve>::ScalarSize>>
) -> SecretKey<C>
Create a new secret key from a serialized scalar value
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<SecretKey<C>, Error>
[src]
Deserialize this secret key from a bytestring
pub fn generate() -> SecretKey<C>
[src]
Generate a new secret key using the operating system's cryptographically secure random number generator
pub fn secret_scalar(&self) -> &GenericArray<u8, <C as Curve>::ScalarSize>
[src]
Expose the secret Scalar<C>
value this SecretKey
wraps
Trait Implementations
impl<C> Drop for SecretKey<C> where
C: Curve,
[src]
C: Curve,
impl<C> Clone for SecretKey<C> where
C: Curve,
[src]
C: Curve,
impl<'a, C> TryFrom<&'a [u8]> for SecretKey<C> where
C: Curve,
[src]
C: Curve,
Auto Trait Implementations
impl<C> Unpin for SecretKey<C> where
<<C as Curve>::ScalarSize as ArrayLength<u8>>::ArrayType: Unpin,
<<C as Curve>::ScalarSize as ArrayLength<u8>>::ArrayType: Unpin,
impl<C> Send for SecretKey<C> where
<C as Curve>::ScalarSize: ArrayLength<u8>,
<C as Curve>::ScalarSize: ArrayLength<u8>,
impl<C> Sync for SecretKey<C> where
<C as Curve>::ScalarSize: ArrayLength<u8>,
<C as Curve>::ScalarSize: ArrayLength<u8>,
impl<C> UnwindSafe for SecretKey<C> where
<<C as Curve>::ScalarSize as ArrayLength<u8>>::ArrayType: UnwindSafe,
<<C as Curve>::ScalarSize as ArrayLength<u8>>::ArrayType: UnwindSafe,
impl<C> RefUnwindSafe for SecretKey<C> where
<<C as Curve>::ScalarSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
<<C as Curve>::ScalarSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,