Skip to main content

open_encrypted_storage

Function open_encrypted_storage 

Source
pub async fn open_encrypted_storage(
    storage: Arc<dyn PeerStorage>,
    db: &str,
    keyring: Option<&Arc<dyn Keyring>>,
) -> Result<Arc<dyn PeerStorage>, StoreError>
Expand description

Resolves the storage keys db needs and wraps storage when it is encrypted.

Returns storage unchanged for an unencrypted database, so a peer that holds no keyring keeps working exactly as before against one.

ยงErrors

Returns StoreError when the manifest cannot be read, when the database is encrypted and keyring is absent, or when an epoch cannot be unwrapped.