iroh_docs::store

Trait PublicKeyStore

Source
pub trait PublicKeyStore {
    // Required method
    fn public_key(&self, id: &[u8; 32]) -> Result<VerifyingKey, SignatureError>;

    // Provided methods
    fn namespace_key(
        &self,
        bytes: &NamespaceId,
    ) -> Result<NamespacePublicKey, SignatureError> { ... }
    fn author_key(
        &self,
        bytes: &AuthorId,
    ) -> Result<AuthorPublicKey, SignatureError> { ... }
}
Expand description

Store trait for expanded public keys for authors and namespaces.

Used to cache [ed25519_dalek::VerifyingKey].

This trait is implemented for the unit type [()], where no caching is used.

Required Methods§

Source

fn public_key(&self, id: &[u8; 32]) -> Result<VerifyingKey, SignatureError>

Convert a byte array into a [VerifyingKey].

New keys are inserted into the `PublicKeyStore and reused on subsequent calls.

Provided Methods§

Source

fn namespace_key( &self, bytes: &NamespaceId, ) -> Result<NamespacePublicKey, SignatureError>

Convert a NamespaceId into a NamespacePublicKey.

New keys are inserted into the `PublicKeyStore and reused on subsequent calls.

Source

fn author_key( &self, bytes: &AuthorId, ) -> Result<AuthorPublicKey, SignatureError>

Convert a AuthorId into a AuthorPublicKey.

New keys are inserted into the `PublicKeyStore and reused on subsequent calls.

Implementations on Foreign Types§

Source§

impl PublicKeyStore for ()

Source§

fn public_key(&self, id: &[u8; 32]) -> Result<VerifyingKey, SignatureError>

Source§

impl<T: PublicKeyStore> PublicKeyStore for &T

Source§

fn public_key(&self, id: &[u8; 32]) -> Result<VerifyingKey, SignatureError>

Source§

impl<T: PublicKeyStore> PublicKeyStore for &mut T

Source§

fn public_key(&self, id: &[u8; 32]) -> Result<VerifyingKey, SignatureError>

Implementors§