Trait oasis_runtime_sdk::keymanager::KeyManager
source · pub trait KeyManager {
// Required methods
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 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.