[][src]Struct signatory::ecdsa::SecretKey

pub struct SecretKey<C> where
    C: SecretValue + Curve
{ /* fields omitted */ }

Elliptic curve secret keys.

This type wraps a secret scalar value, helping to prevent accidental exposure and securely erasing the value from memory when dropped (when the zeroize feature of this crate is enabled).

Implementations

impl<C> SecretKey<C> where
    C: Curve + SecretValue,
    <C as SecretValue>::Secret: Clone,
    <C as SecretValue>::Secret: Zeroize,
    GenericArray<u8, <C as Curve>::FieldSize>: From<<C as SecretValue>::Secret>, 
[src]

pub fn new(secret_value: <C as SecretValue>::Secret) -> SecretKey<C>[src]

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 to_bytes(&self) -> GenericArray<u8, <C as Curve>::FieldSize>[src]

Expose the byte serialization of the value this SecretKey wraps

Trait Implementations

impl<C> Clone for SecretKey<C> where
    C: SecretValue + Curve + Clone,
    <C as SecretValue>::Secret: Clone
[src]

impl<C> Debug for SecretKey<C> where
    C: Curve + SecretValue
[src]

impl<C> Drop for SecretKey<C> where
    C: Curve + SecretValue
[src]

impl<'_, C> TryFrom<&'_ [u8]> for SecretKey<C> where
    C: Curve + SecretValue,
    <C as SecretValue>::Secret: Clone,
    <C as SecretValue>::Secret: Zeroize,
    GenericArray<u8, <C as Curve>::FieldSize>: From<<C as SecretValue>::Secret>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<C> RefUnwindSafe for SecretKey<C> where
    <C as SecretValue>::Secret: RefUnwindSafe

impl<C> Send for SecretKey<C> where
    <C as SecretValue>::Secret: Send

impl<C> Sync for SecretKey<C> where
    <C as SecretValue>::Secret: Sync

impl<C> Unpin for SecretKey<C> where
    <C as SecretValue>::Secret: Unpin

impl<C> UnwindSafe for SecretKey<C> where
    <C as SecretValue>::Secret: UnwindSafe

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> Same<T> for T

type Output = T

Should always be Self

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.