Trait iroh_docs::store::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§