Trait farcaster_core::crypto::GenerateKey
source · pub trait GenerateKey<PublicKey, KeyId> {
fn get_pubkey(&mut self, key_id: KeyId) -> Result<PublicKey, Error>;
fn get_pubkeys(
&mut self,
key_ids: Vec<KeyId>
) -> Result<Vec<PublicKey>, Error> { ... }
}Expand description
Public key generator. Generic interface over PublicKey, the public key type, and KeyId, the
identifier, used to retreive public keys by their identifiers.
Required Methods§
sourcefn get_pubkey(&mut self, key_id: KeyId) -> Result<PublicKey, Error>
fn get_pubkey(&mut self, key_id: KeyId) -> Result<PublicKey, Error>
Retreive a specific public key by its key id. If the key cannot be derived the
implementation must return an Error::UnsupportedKey, otherwise Ok(PublicKey) is
returned.
Provided Methods§
sourcefn get_pubkeys(&mut self, key_ids: Vec<KeyId>) -> Result<Vec<PublicKey>, Error>
fn get_pubkeys(&mut self, key_ids: Vec<KeyId>) -> Result<Vec<PublicKey>, Error>
Return a vector of public keys matching the vector of key ids. Errors on the first key that
can’t be derived and return an Error::UnsupportedKey.