pub enum Storage {
    GitHubStorage(GitHubStorage),
    VaultStorage(VaultStorage),
    InMemoryStorage(InMemoryStorage),
    NamespacedStorage(Namespaced<Box<Storage>>),
    OnDiskStorage(OnDiskStorage),
}
Expand description

This is the interface into secure storage. Any storage engine implementing this trait should support both key/value operations (e.g., get, set and create) and cryptographic key operations (e.g., generate_key, sign and rotate_key). This is a hack that allows us to convert from SecureBackend into a useable T: Storage. This boilerplate can be 100% generated by a proc macro.

Variants

GitHubStorage(GitHubStorage)

VaultStorage(VaultStorage)

InMemoryStorage(InMemoryStorage)

NamespacedStorage(Namespaced<Box<Storage>>)

OnDiskStorage(OnDiskStorage)

Trait Implementations

Securely generates a new named Ed25519 private key. The behavior for calling this interface multiple times with the same name is implementation specific.

Returns the Ed25519 private key stored at ‘name’.

An optional API that allows importing private keys and storing them at the provided name. This is not intended to be used in production and the API may throw unimplemented if not used correctly. As this is purely a testing API, there is no defined behavior for importing a key for a given name if that name already exists. It only exists to allow running in test environments where a set of deterministic keys must be generated.

Returns the Ed25519 private key stored at ‘name’ and identified by ‘version’, which is the corresponding public key. This may fail even if the ‘named’ key exists but the version is not present.

Returns the Ed25519 public key stored at ‘name’.

Returns the previous version of the Ed25519 public key stored at ‘name’. For the most recent version, see ‘get_public_key(..)’ above.

Rotates an Ed25519 private key. Future calls without version to this ‘named’ key will return the rotated key instance. The previous key is retained and can be accessed via the version. At most two versions are expected to be retained.

Signs the provided securely-hashable struct, using the ‘named’ private key.

Signs the provided securely-hashable struct, using the ‘named’ and ‘versioned’ private key. This may fail even if the ‘named’ key exists but the version is not present.

Securely generates a new named Ed25519 private key. The behavior for calling this interface multiple times with the same name is implementation specific. Read more

Returns the Ed25519 private key stored at ‘name’.

An optional API that allows importing private keys and storing them at the provided name. This is not intended to be used in production and the API may throw unimplemented if not used correctly. As this is purely a testing API, there is no defined behavior for importing a key for a given name if that name already exists. It only exists to allow running in test environments where a set of deterministic keys must be generated. Read more

Returns the Ed25519 private key stored at ‘name’ and identified by ‘version’, which is the corresponding public key. This may fail even if the ‘named’ key exists but the version is not present. Read more

Returns the Ed25519 public key stored at ‘name’.

Returns the previous version of the Ed25519 public key stored at ‘name’. For the most recent version, see ‘get_public_key(..)’ above. Read more

Rotates an Ed25519 private key. Future calls without version to this ‘named’ key will return the rotated key instance. The previous key is retained and can be accessed via the version. At most two versions are expected to be retained. Read more

Signs the provided securely-hashable struct, using the ‘named’ private key. Read more

Signs the provided securely-hashable struct, using the ‘named’ and ‘versioned’ private key. This may fail even if the ‘named’ key exists but the version is not present. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Returns an error if the backend service is not online and available.

Retrieves a value from storage and fails if the backend is unavailable or the process has invalid permissions.

Sets a value in storage and fails if the backend is unavailable or the process has invalid permissions.

Returns an error if the backend service is not online and available.

Retrieves a value from storage and fails if the backend is unavailable or the process has invalid permissions. Read more

Sets a value in storage and fails if the backend is unavailable or the process has invalid permissions. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more