pub trait PublicKeyStore {
// Required method
fn public_key(&self, id: &[u8; 32]) -> Result<PublicKey, KeyParsingError>;
// Provided methods
fn namespace_key(
&self,
bytes: &NamespaceId,
) -> Result<NamespacePublicKey, KeyParsingError> { ... }
fn author_key(
&self,
bytes: &AuthorId,
) -> Result<AuthorPublicKey, KeyParsingError> { ... }
}Expand description
Store trait for expanded public keys for authors and namespaces.
Used to cache iroh::PublicKey.
This trait is implemented for the unit type (), where no caching is used.
Required Methods§
Sourcefn public_key(&self, id: &[u8; 32]) -> Result<PublicKey, KeyParsingError>
fn public_key(&self, id: &[u8; 32]) -> Result<PublicKey, KeyParsingError>
Convert a byte array into a iroh::PublicKey.
New keys are inserted into the PublicKeyStore and reused on subsequent calls.
Provided Methods§
Sourcefn namespace_key(
&self,
bytes: &NamespaceId,
) -> Result<NamespacePublicKey, KeyParsingError>
fn namespace_key( &self, bytes: &NamespaceId, ) -> Result<NamespacePublicKey, KeyParsingError>
Convert a NamespaceId into a NamespacePublicKey.
New keys are inserted into the PublicKeyStore and reused on subsequent calls.
Convert a AuthorId into a AuthorPublicKey.
New keys are inserted into the PublicKeyStore and reused on subsequent calls.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".