SigningKey

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 of signature created by this key

type VerifyingKey: VerifyingKey

Type of key used to verify produced signatures

type Error: Error + Send + Sync + 'static

Type of error that can occur when signing

Required Methods§

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

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.

Implementors§

§

impl SigningKey for delta_domain_sdk::base::crypto::ed25519::PrivKey

§

impl SigningKey for PrivKey

§

type Signature = Signature

§

type VerifyingKey = PubKey

§

type Error = SignError