Trait SigningKey
pub trait SigningKey: Sized {
type Signature;
type VerifyingKey: VerifyingKey;
type Error: Error + Send + Sync + 'static;
// Required methods
fn sign_bytes(
&self,
bytes: impl AsRef<[u8]>,
) -> Result<Self::Signature, Self::Error>;
fn pub_key(&self) -> Self::VerifyingKey;
}Expand description
A trait for any type of private key that can be used to sign data.
Required Associated Types§
type Signature
type Signature
Type of signature created by this key
type VerifyingKey: VerifyingKey
type VerifyingKey: VerifyingKey
Type of key used to verify produced signatures
Required Methods§
fn sign_bytes(
&self,
bytes: impl AsRef<[u8]>,
) -> Result<Self::Signature, Self::Error>
fn sign_bytes( &self, bytes: impl AsRef<[u8]>, ) -> Result<Self::Signature, Self::Error>
Sign some bytes using this key
fn pub_key(&self) -> Self::VerifyingKey
fn pub_key(&self) -> Self::VerifyingKey
Get the [VerifyingKey] associated with this SigningKey
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.