Trait oasis_runtime_sdk::keymanager::KeyManager
source · pub trait KeyManager {
// Required methods
fn runtime_id(&self) -> Option<Namespace>;
fn runtime_signing_key(&self) -> Option<PublicKey>;
fn clear_cache(&self);
fn get_or_create_keys(
&self,
key_pair_id: KeyPairId,
) -> Result<KeyPair, KeyManagerError>;
fn get_public_key(
&self,
key_pair_id: KeyPairId,
) -> Result<SignedPublicKey, KeyManagerError>;
fn get_or_create_ephemeral_keys(
&self,
key_pair_id: KeyPairId,
epoch: EpochTime,
) -> Result<KeyPair, KeyManagerError>;
fn get_public_ephemeral_key(
&self,
key_pair_id: KeyPairId,
epoch: EpochTime,
) -> Result<SignedPublicKey, KeyManagerError>;
fn box_clone(&self) -> Box<dyn KeyManager>;
}
Expand description
Key manager interface.
Required Methods§
sourcefn runtime_id(&self) -> Option<Namespace>
fn runtime_id(&self) -> Option<Namespace>
Key manager runtime identifier this client is connected to. It may be None
in case the
identifier is not known yet (e.g. the client has not yet been initialized).
See the oasis-core documentation for details.
sourcefn runtime_signing_key(&self) -> Option<PublicKey>
fn runtime_signing_key(&self) -> Option<PublicKey>
Key manager runtime signing key used to sign messages from the key manager.
See the oasis-core documentation for details.
sourcefn clear_cache(&self)
fn clear_cache(&self)
Clear local key cache.
See the oasis-core documentation for details.
sourcefn get_or_create_keys(
&self,
key_pair_id: KeyPairId,
) -> Result<KeyPair, KeyManagerError>
fn get_or_create_keys( &self, key_pair_id: KeyPairId, ) -> Result<KeyPair, KeyManagerError>
Get or create named key pair.
See the oasis-core documentation for details. This variant of the method synchronously blocks for the result.
sourcefn get_public_key(
&self,
key_pair_id: KeyPairId,
) -> Result<SignedPublicKey, KeyManagerError>
fn get_public_key( &self, key_pair_id: KeyPairId, ) -> Result<SignedPublicKey, KeyManagerError>
Get public key for a key pair id.
See the oasis-core documentation for details. This variant of the method synchronously blocks for the result.
sourcefn get_or_create_ephemeral_keys(
&self,
key_pair_id: KeyPairId,
epoch: EpochTime,
) -> Result<KeyPair, KeyManagerError>
fn get_or_create_ephemeral_keys( &self, key_pair_id: KeyPairId, epoch: EpochTime, ) -> Result<KeyPair, KeyManagerError>
Get or create named ephemeral key pair for given epoch.
See the oasis-core documentation for details. This variant of the method synchronously blocks for the result.
sourcefn get_public_ephemeral_key(
&self,
key_pair_id: KeyPairId,
epoch: EpochTime,
) -> Result<SignedPublicKey, KeyManagerError>
fn get_public_ephemeral_key( &self, key_pair_id: KeyPairId, epoch: EpochTime, ) -> Result<SignedPublicKey, KeyManagerError>
Get ephemeral public key for an epoch and a key pair id.
See the oasis-core documentation for details. This variant of the method synchronously blocks for the result.