Trait tor_hsservice::internal_prelude::ed25519::Signer

pub trait Signer<S> {
    // Required method
    fn try_sign(&self, msg: &[u8]) -> Result<S, Error>;

    // Provided method
    fn sign(&self, msg: &[u8]) -> S { ... }
}
Expand description

Sign the provided message bytestring using Self (e.g. a cryptographic key or connection to an HSM), returning a digital signature.

Required Methods§

fn try_sign(&self, msg: &[u8]) -> Result<S, Error>

Attempt to sign the given message, returning a digital signature on success, or an error if something went wrong.

The main intended use case for signing errors is when communicating with external signers, e.g. cloud KMS, HSMs, or other hardware tokens.

Provided Methods§

fn sign(&self, msg: &[u8]) -> S

Sign the given message and return a digital signature

Implementations on Foreign Types§

§

impl Signer<Signature> for KeypairData

§

fn try_sign(&self, message: &[u8]) -> Result<Signature, Error>

§

impl Signer<Signature> for PrivateKey

§

fn try_sign(&self, message: &[u8]) -> Result<Signature, Error>

§

impl<D> Signer<Signature> for SigningKey<D>
where D: Digest,

§

fn try_sign(&self, msg: &[u8]) -> Result<Signature, Error>

Implementors§

§

impl Signer<Signature> for HsBlindIdKeypair

§

impl Signer<Signature> for tor_hsservice::internal_prelude::ed25519::Keypair