Struct ockam_vault::SoftwareVault [−][src]
pub struct SoftwareVault { /* fields omitted */ }
Expand description
Vault implementation that stores secrets in memory and uses software crypto.
Examples
use ockam_vault::SoftwareVault; use ockam_vault_core::{SecretAttributes, SecretType, SecretPersistence, CURVE25519_SECRET_LENGTH, SecretVault, Signer, Verifier}; fn example() -> ockam_core::Result<()> { let mut vault = SoftwareVault::default(); let mut attributes = SecretAttributes::new( SecretType::Curve25519, SecretPersistence::Ephemeral, CURVE25519_SECRET_LENGTH, ); let secret = vault.secret_generate(attributes)?; let public = vault.secret_public_key_get(&secret)?; let data = "Very important stuff".as_bytes(); let signature = vault.sign(&secret, data)?; assert!(vault.verify(&signature, &public, data)?); Ok(()) }
Implementations
Trait Implementations
Compute sha256. Salt and Ikm should be of Buffer type. Output secrets should be only of type Buffer or AES
Generate fresh secret. Only Curve25519 and Buffer types are supported
Extract public key from secret. Only Curve25519 type is supported
Remove secret from memory
Import a secret with given attributes from binary form into the vault
Export a secret key to the binary form represented as SecretKey
Get the attributes for a secret
Encrypt a payload using AES-GCM
Auto Trait Implementations
impl RefUnwindSafe for SoftwareVault
impl Send for SoftwareVault
impl Sync for SoftwareVault
impl Unpin for SoftwareVault
impl UnwindSafe for SoftwareVault