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§

source

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.

source

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.

source

fn clear_cache(&self)

Clear local key cache.

See the oasis-core documentation for details.

source

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.

source

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.

source

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.

source

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.

source

fn box_clone(&self) -> Box<dyn KeyManager>

Trait Implementations§

source§

impl Clone for Box<dyn KeyManager>

source§

fn clone(&self) -> Box<dyn KeyManager>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§