Struct rustls::sign::EcdsaSigningKey

source ·
struct EcdsaSigningKey {
    key: Arc<EcdsaKeyPair>,
    scheme: SignatureScheme,
}
Expand description

A SigningKey that uses exactly one TLS-level SignatureScheme and one ring-level signature::SigningAlgorithm.

Compare this to RsaSigningKey, which for a particular key is willing to sign with several algorithms. This is quite poor cryptography practice, but is necessary because a given RSA key is expected to work in TLS1.2 (PKCS#1 signatures) and TLS1.3 (PSS signatures) – nobody is willing to obtain certificates for different protocol versions.

Currently this is only implemented for ECDSA keys.

Fields§

§key: Arc<EcdsaKeyPair>§scheme: SignatureScheme

Implementations§

source§

impl EcdsaSigningKey

source

fn new( der: &PrivateKey, scheme: SignatureScheme, sigalg: &'static EcdsaSigningAlgorithm, ) -> Result<Self, ()>

Make a new ECDSASigningKey from a DER encoding in PKCS#8 or SEC1 format, expecting a key usable with precisely the given signature scheme.

source

fn convert_sec1_to_pkcs8( scheme: SignatureScheme, sigalg: &'static EcdsaSigningAlgorithm, maybe_sec1_der: &[u8], rng: &dyn SecureRandom, ) -> Result<EcdsaKeyPair, ()>

Convert a SEC1 encoding to PKCS8, and ask ring to parse it. This can be removed once https://github.com/briansmith/ring/pull/1456 (or equivalent) is landed.

Trait Implementations§

source§

impl SigningKey for EcdsaSigningKey

source§

fn choose_scheme(&self, offered: &[SignatureScheme]) -> Option<Box<dyn Signer>>

Choose a SignatureScheme from those offered. Read more
source§

fn algorithm(&self) -> SignatureAlgorithm

What kind of key we have.

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> 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, U> TryFrom<U> for T
where 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 T
where 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.