pub struct SigningKey<C>where
    C: CurveAlg,
    SignatureSize<C>: ArrayLength<u8>,{ /* private fields */ }
Available on crate feature signature only.
Expand description

ECDSA signing key. Generic over elliptic curves.

Implementations§

source§

impl<C> SigningKey<C>where C: CurveAlg, SignatureSize<C>: ArrayLength<u8>,

source

pub fn from_keypair_bytes( signing_key: &[u8], verifying_key: &[u8] ) -> Result<Self, Error>

Initialize a SigningKey from a raw keypair

source

pub fn verifying_key(&self) -> VerifyingKey<C>where FieldBytesSize<C>: ModulusSize,

Get the VerifyingKey for this SigningKey

Trait Implementations§

source§

impl<C> DecodePrivateKey for SigningKey<C>where C: CurveAlg, SignatureSize<C>: ArrayLength<u8>,

source§

fn from_pkcs8_der(pkcs8_bytes: &[u8]) -> Result<Self, Error>

Deserialize PKCS#8 private key from ASN.1 DER-encoded data (binary format).
source§

fn read_pkcs8_der_file(path: impl AsRef<Path>) -> Result<Self, Error>

Available on crate feature std only.
Load PKCS#8 private key from an ASN.1 DER-encoded file on the local filesystem (binary format).
source§

impl<C> Keypair for SigningKey<C>where C: CurveAlg, FieldBytesSize<C>: ModulusSize, SignatureSize<C>: ArrayLength<u8>,

§

type VerifyingKey = VerifyingKey<C>

Verifying key type for this keypair.
source§

fn verifying_key(&self) -> VerifyingKey<C>

Get the verifying key which can verify signatures produced by the signing key portion of this keypair.
source§

impl<C> Signer<Signature<C>> for SigningKey<C>where C: CurveAlg, SignatureSize<C>: ArrayLength<u8>,

source§

fn try_sign(&self, msg: &[u8]) -> Result<Signature<C>, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong. Read more
source§

fn sign(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature

Auto Trait Implementations§

§

impl<C> RefUnwindSafe for SigningKey<C>where C: RefUnwindSafe,

§

impl<C> Send for SigningKey<C>

§

impl<C> Sync for SigningKey<C>

§

impl<C> Unpin for SigningKey<C>where C: Unpin,

§

impl<C> UnwindSafe for SigningKey<C>where C: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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

§

type Output = T

Should always be Self
source§

impl<S, T> SignerMut<S> for Twhere T: Signer<S>,

source§

fn try_sign(&mut self, msg: &[u8]) -> Result<S, Error>

Attempt to sign the given message, updating the state, and returning a digital signature on success, or an error if something went wrong. Read more
source§

fn sign(&mut self, msg: &[u8]) -> S

Sign the given message, update the state, and return a digital signature.
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.