[][src]Enum libra_secure_storage::Storage

pub enum Storage {
    GitHubStorage(GitHubStorage),
    VaultStorage(VaultStorage),
    InMemoryStorage(InMemoryStorage),
    NamespacedStorage(NamespacedStorage),
    OnDiskStorage(OnDiskStorage),
}

This is the Libra 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(NamespacedStorage)
OnDiskStorage(OnDiskStorage)

Trait Implementations

impl CryptoStorage for Storage[src]

fn create_key(&mut self, name: &str) -> Result<Ed25519PublicKey, Error>[src]

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

fn export_private_key(&self, name: &str) -> Result<Ed25519PrivateKey, Error>[src]

Returns the Ed25519 private key stored at 'name'.

fn import_private_key(
    &mut self,
    name: &str,
    key: Ed25519PrivateKey
) -> Result<(), Error>
[src]

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 Libra to be run in test environments where a set of deterministic keys must be generated.

fn export_private_key_for_version(
    &self,
    name: &str,
    version: Ed25519PublicKey
) -> Result<Ed25519PrivateKey, Error>
[src]

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.

fn get_public_key(&self, name: &str) -> Result<PublicKeyResponse, Error>[src]

Returns the Ed25519 public key stored at 'name'.

fn get_public_key_previous_version(
    &self,
    name: &str
) -> Result<Ed25519PublicKey, Error>
[src]

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

fn rotate_key(&mut self, name: &str) -> Result<Ed25519PublicKey, Error>[src]

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.

fn sign<T: CryptoHash + Serialize>(
    &self,
    name: &str,
    message: &T
) -> Result<Ed25519Signature, Error>
[src]

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

fn sign_using_version<T: CryptoHash + Serialize>(
    &self,
    name: &str,
    version: Ed25519PublicKey,
    message: &T
) -> Result<Ed25519Signature, Error>
[src]

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.

impl From<GitHubStorage> for Storage[src]

impl From<InMemoryStorageInternal<RealTimeService>> for Storage[src]

impl From<NamespacedStorage> for Storage[src]

impl From<OnDiskStorageInternal<RealTimeService>> for Storage[src]

impl From<VaultStorage> for Storage[src]

impl KVStorage for Storage[src]

fn available(&self) -> Result<(), Error>[src]

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

fn get<T: DeserializeOwned>(&self, key: &str) -> Result<GetResponse<T>, Error>[src]

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

fn set<T: Serialize>(&mut self, key: &str, value: T) -> Result<(), Error>[src]

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

fn reset_and_clear(&mut self) -> Result<(), Error>[src]

Resets and clears all data held in the storage engine. Note: this should only be exposed and used for testing. Resetting the storage engine is not something that should be supported in production.

impl TryInto<GitHubStorage> for Storage[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl TryInto<InMemoryStorageInternal<RealTimeService>> for Storage[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl TryInto<NamespacedStorage> for Storage[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl TryInto<OnDiskStorageInternal<RealTimeService>> for Storage[src]

type Error = &'static str

The type returned in the event of a conversion error.

impl TryInto<VaultStorage> for Storage[src]

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Storage

impl Send for Storage

impl Sync for Storage

impl Unpin for Storage

impl UnwindSafe for Storage

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,