pub trait PrivateKey: Sealed + Sized {
    type Public: PublicKey<Private = Self>;

    // Required method
    fn public(&self) -> Self::Public;

    // Provided method
    fn sign<S: Signature<PrivateKey = Self>>(
        &self,
        message: &[u8]
    ) -> Result<S, Error> { ... }
}
Expand description

The private component of a public/private key pair.

Required Associated Types§

source

type Public: PublicKey<Private = Self>

The type of the public component.

Required Methods§

source

fn public(&self) -> Self::Public

Gets the public key corresponding to this private key.

Provided Methods§

source

fn sign<S: Signature<PrivateKey = Self>>( &self, message: &[u8] ) -> Result<S, Error>

Signs a message with this private key.

sign signs a message with this key using the signature scheme S. It is equivalent to S::sign(self, message).

Object Safety§

This trait is not object safe.

Implementors§