Trait radicle_keystore::Keystore
source · [−]pub trait Keystore {
type PublicKey: From<Self::SecretKey>;
type SecretKey: SecretKeyExt<Metadata = Self::Metadata>;
type Metadata;
type Error: Error;
fn put_key(&mut self, key: Self::SecretKey) -> Result<(), Self::Error>;
fn get_key(
&self
) -> Result<Keypair<Self::PublicKey, Self::SecretKey>, Self::Error>;
fn show_key(&self) -> Result<(Self::PublicKey, Self::Metadata), Self::Error>;
}
Expand description
Abstraction over secure storage for private key material.
Associated Types
type SecretKey: SecretKeyExt<Metadata = Self::Metadata>
Required methods
Securely store secret key key
in the keystore.
The key may carry Keystore::Metadata
, which is stored alongside the
key material. The metadata, as well as the public portion of the
key, may be stored in clear, so as to not require prompting the user
when retrieving those values.
Key rotation is not (yet) part of this API, thus put_key
MUST return
an error if an equivalent key is already present in the storage
backend.
Retrieve both the secret and public parts of the stored key material.