Trait ockam_vault::SecretVault
source · [−]pub trait SecretVault {
fn secret_generate<'life0, 'async_trait>(
&'life0 self,
attributes: SecretAttributes
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn secret_import<'life0, 'life1, 'async_trait>(
&'life0 self,
secret: &'life1 [u8],
attributes: SecretAttributes
) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn secret_export<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 String
) -> Pin<Box<dyn Future<Output = Result<SecretKey, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn secret_attributes_get<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 String
) -> Pin<Box<dyn Future<Output = Result<SecretAttributes, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn secret_public_key_get<'life0, 'life1, 'async_trait>(
&'life0 self,
key_id: &'life1 String
) -> Pin<Box<dyn Future<Output = Result<PublicKey, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn secret_destroy<'life0, 'async_trait>(
&'life0 self,
key_id: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Defines the Secret
management interface for Ockam Vaults.
Examples
See ockam_vault::SoftwareVault
for a usage example.
Required Methods
Generate a fresh secret with the given attributes.
Import a secret with the given attributes from binary form into the vault.
Export a secret key to the binary form represented as SecretKey
.
Return the attributes for a secret.
Return the associated public key given the secret key.