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§
Sourcefn public_key(&self, id: &[u8; 32]) -> Result<VerifyingKey, SignatureError>
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§
Sourcefn namespace_key(
&self,
bytes: &NamespaceId,
) -> Result<NamespacePublicKey, SignatureError>
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.
Convert a AuthorId
into a AuthorPublicKey
.
New keys are inserted into the `PublicKeyStore and reused on subsequent calls.