Trait ockam_vault::SecretVault [−][src]
pub trait SecretVault: Zeroize {
fn secret_generate(
&mut self,
attributes: SecretAttributes
) -> Result<Secret, Error>;
fn secret_import(
&mut self,
secret: &[u8],
attributes: SecretAttributes
) -> Result<Secret, Error>;
fn secret_export(&mut self, context: &Secret) -> Result<SecretKey, Error>;
fn secret_attributes_get(
&mut self,
context: &Secret
) -> Result<SecretAttributes, Error>;
fn secret_public_key_get(
&mut self,
context: &Secret
) -> Result<PublicKey, Error>;
fn secret_destroy(&mut self, context: Secret) -> Result<(), Error>;
}
Expand description
Secret
-management functionality
Required methods
fn secret_generate(
&mut self,
attributes: SecretAttributes
) -> Result<Secret, Error>
fn secret_generate(
&mut self,
attributes: SecretAttributes
) -> Result<Secret, Error>
Generate fresh secret with given attributes
fn secret_import(
&mut self,
secret: &[u8],
attributes: SecretAttributes
) -> Result<Secret, Error>
fn secret_import(
&mut self,
secret: &[u8],
attributes: SecretAttributes
) -> Result<Secret, Error>
Import a secret with given attributes from binary form into the vault
Export a secret key to the binary form represented as SecretKey
fn secret_attributes_get(
&mut self,
context: &Secret
) -> Result<SecretAttributes, Error>
fn secret_attributes_get(
&mut self,
context: &Secret
) -> Result<SecretAttributes, Error>
Get the attributes for a secret
Return the associated public key given the secret key