Signable

Trait Signable 

pub trait Signable<K>: TypedSerialize
where K: SigningKey,
{ // Provided method fn sign(&self, key: &K) -> Result<<K as SigningKey>::Signature, SignError> { ... } }
Expand description

A trait for any type that can be signed using some SigningKey

[TypedSerialize] is used to prevent signature collisions when different types X and Y have the same serialized bytes.

Requirement: The key must sign only through this trait.

Provided Methods§

fn sign(&self, key: &K) -> Result<<K as SigningKey>::Signature, SignError>

Sign this Signable using the provided SigningKey.

§Arguments

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<T, K> Signable<K> for T
where T: TypedSerialize, K: SigningKey,