SignerKey

Trait SignerKey 

Source
pub trait SignerKey:
    Sign
    + Send
    + Sync {
    // Required methods
    fn fingerprint(&self) -> Vec<u8> ;
    fn public_key(&self) -> Vec<u8> ;
}
Expand description

Trait for keys that can be stored in a keychain.

This trait extends Sign with methods for key identification. All key types in rust-bottle implement this trait, allowing them to be stored in keychains.

§Requirements

  • Sign: Must be able to sign messages
  • Send + Sync: Must be safe to send across threads

Required Methods§

Source

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

Get the public key fingerprint (SHA-256 hash of public key).

The fingerprint is used as the key in the keychain’s internal HashMap for fast lookup.

§Returns

SHA-256 hash of the public key bytes

Source

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

Get the public key bytes.

§Returns

Public key bytes in the key’s native format

Implementors§