SigningKey

Trait SigningKey 

Source
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§

Source

fn sign_sha256(&self, message: &[u8]) -> Vec<u8>

Sign the message using the SHA-256 digest

Source

fn sign_sha384(&self, message: &[u8]) -> Vec<u8>

Sign the message using the SHA-384 digest

Source

fn sign_sha512(&self, message: &[u8]) -> Vec<u8>

Sign the message using the SHA-512 digest

Source

fn verifying_key(&self) -> Box<dyn VerifyingKey>

Create a verifying key from this key.

Source

fn from_pkcs8_der(der: &[u8]) -> Option<Self>
where Self: Sized,

Create a new key from a PKCS8 der.

Source

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>

Source§

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>

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>

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 from_pkcs8_der(der: &[u8]) -> Option<Self>
where Self: Sized,

Source§

fn from_sec1_der(der: &[u8]) -> Option<Self>
where Self: Sized,

Source§

fn verifying_key(&self) -> Box<dyn VerifyingKey>

Implementors§