Skip to main content

KeyProvider

Trait KeyProvider 

Source
pub trait KeyProvider:
    Clone
    + Send
    + Sync
    + 'static {
    type Error: Into<SecioError>;

    // Required methods
    fn sign_ecdsa<T: AsRef<[u8]>>(
        &self,
        message: T,
    ) -> Result<Vec<u8>, Self::Error>;
    fn pubkey(&self) -> Vec<u8> ;
    fn verify_ecdsa<P, T, F>(&self, pubkey: P, message: T, signature: F) -> bool
       where P: AsRef<[u8]>,
             T: AsRef<[u8]>,
             F: AsRef<[u8]>;
}
Expand description

KeyProvider on ecdh procedure

Required Associated Types§

Required Methods§

Source

fn sign_ecdsa<T: AsRef<[u8]>>(&self, message: T) -> Result<Vec<u8>, Self::Error>

Constructs a signature for msg using the secret key sk

Source

fn pubkey(&self) -> Vec<u8>

Creates a new public key from the KeyProvider.

Source

fn verify_ecdsa<P, T, F>(&self, pubkey: P, message: T, signature: F) -> bool
where P: AsRef<[u8]>, T: AsRef<[u8]>, F: AsRef<[u8]>,

Checks that sig is a valid ECDSA signature for msg using the pubkey.

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§