pub trait SigningKey {
// Required methods
fn sign_sha256(&self, message: &[u8]) -> Vec<u8> ⓘ;
fn sign_sha384(&self, message: &[u8]) -> Vec<u8> ⓘ;
fn sign_sha512(&self, message: &[u8]) -> Vec<u8> ⓘ;
fn verifying_key(&self) -> Box<dyn VerifyingKey>;
fn from_pkcs8_der(der: &[u8]) -> Option<Self>
where Self: Sized;
fn from_sec1_der(der: &[u8]) -> Option<Self>
where Self: Sized;
}Expand description
A signing key using ECDSA.
Required Methods§
Sourcefn verifying_key(&self) -> Box<dyn VerifyingKey>
fn verifying_key(&self) -> Box<dyn VerifyingKey>
Create a verifying key from this key.
Sourcefn from_pkcs8_der(der: &[u8]) -> Option<Self>where
Self: Sized,
fn from_pkcs8_der(der: &[u8]) -> Option<Self>where
Self: Sized,
Create a new key from a PKCS8 der.
Sourcefn from_sec1_der(der: &[u8]) -> Option<Self>where
Self: Sized,
fn from_sec1_der(der: &[u8]) -> Option<Self>where
Self: Sized,
Create a new key from a sec1 EC private key der.
Implementations on Foreign Types§
Source§impl<C> SigningKey for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + AssociatedOid,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: ModulusSize,
SignatureSize<C>: ArraySize,
Self: RandomizedPrehashSigner<Signature<C>> + DecodePrivateKey,
VerifyingKey<C>: DecodePublicKey,
impl<C> SigningKey for SigningKey<C>where
C: EcdsaCurve + CurveArithmetic + AssociatedOid,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: ModulusSize,
SignatureSize<C>: ArraySize,
Self: RandomizedPrehashSigner<Signature<C>> + DecodePrivateKey,
VerifyingKey<C>: DecodePublicKey,
Source§fn sign_sha256(&self, message: &[u8]) -> Vec<u8> ⓘ
fn sign_sha256(&self, message: &[u8]) -> Vec<u8> ⓘ
Sign the message using this key.
§Panics
- If the digest length is less than half the field size of the curve.
- Any other errors occur during signing.
Source§fn sign_sha384(&self, message: &[u8]) -> Vec<u8> ⓘ
fn sign_sha384(&self, message: &[u8]) -> Vec<u8> ⓘ
Sign the message using this key.
§Panics
- If the digest length is less than half the field size of the curve.
- Any other errors occur during signing.
Source§fn sign_sha512(&self, message: &[u8]) -> Vec<u8> ⓘ
fn sign_sha512(&self, message: &[u8]) -> Vec<u8> ⓘ
Sign the message using this key.
§Panics
- If the digest length is less than half the field size of the curve.
- Any other errors occur during signing.