pub trait AnyVaultKeyStorage: Send + Sync + Debug + 'static {
    // Required methods
    fn vault_key_for(
        &self,
        storage_id: StorageId
    ) -> Result<Option<KeyPair>, Error>;
    fn set_vault_key_for(
        &self,
        storage_id: StorageId,
        key: KeyPair
    ) -> Result<(), Error>;
}
Expand description

A VaultKeyStorage trait that wraps the Error type before returning. This type is used to allow the Vault to operate without any generic parameters. This trait is auto-implemented for all VaultKeyStorage implementors.

Required Methods§

source

fn vault_key_for(&self, storage_id: StorageId) -> Result<Option<KeyPair>, Error>

Retrieve all previously stored master keys for a given storage id.

source

fn set_vault_key_for( &self, storage_id: StorageId, key: KeyPair ) -> Result<(), Error>

Store a key. Each server id should have unique storage. The keys are uniquely encrypted per storage id and can only be decrypted by keys contained in the storage itself.

Implementors§

source§

impl<T> AnyVaultKeyStorage for T
where T: VaultKeyStorage + 'static,