Struct ockam_vault::SoftwareVault [−][src]
pub struct SoftwareVault { /* fields omitted */ }
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
impl SoftwareVault
[src]
impl SoftwareVault
[src]pub fn error_domain_static() -> &'static str
[src]
Return the error domain for this Vault
impl SoftwareVault
[src]
impl SoftwareVault
[src]Trait Implementations
impl AsymmetricVault for SoftwareVault
[src]
impl AsymmetricVault for SoftwareVault
[src]impl Default for SoftwareVault
[src]
impl Default for SoftwareVault
[src]impl Drop for SoftwareVault
[src]
impl Drop for SoftwareVault
[src]impl ErrorVault for SoftwareVault
[src]
impl ErrorVault for SoftwareVault
[src]fn error_domain(&self) -> &'static str
[src]
impl Hasher for SoftwareVault
[src]
impl Hasher for SoftwareVault
[src]fn sha256(&mut self, data: &[u8]) -> Result<[u8; 32]>
[src]
fn hkdf_sha256(
&mut self,
salt: &Secret,
info: &[u8],
ikm: Option<&Secret>,
output_attributes: Vec<SecretAttributes>
) -> Result<Vec<Secret>>
[src]
&mut self,
salt: &Secret,
info: &[u8],
ikm: Option<&Secret>,
output_attributes: Vec<SecretAttributes>
) -> Result<Vec<Secret>>
Compute sha256. Salt and Ikm should be of Buffer type. Output secrets should be only of type Buffer or AES
impl KeyIdVault for SoftwareVault
[src]
impl KeyIdVault for SoftwareVault
[src]fn get_secret_by_key_id(&mut self, key_id: &str) -> Result<Secret>
[src]
fn compute_key_id_for_public_key(
&mut self,
public_key: &PublicKey
) -> Result<KeyId>
[src]
&mut self,
public_key: &PublicKey
) -> Result<KeyId>
impl SecretVault for SoftwareVault
[src]
impl SecretVault for SoftwareVault
[src]fn secret_generate(&mut self, attributes: SecretAttributes) -> Result<Secret>
[src]
Generate fresh secret. Only Curve25519 and Buffer types are supported
fn secret_import(
&mut self,
secret: &[u8],
attributes: SecretAttributes
) -> Result<Secret>
[src]
&mut self,
secret: &[u8],
attributes: SecretAttributes
) -> Result<Secret>
fn secret_export(&mut self, context: &Secret) -> Result<SecretKey>
[src]
fn secret_attributes_get(
&mut self,
context: &Secret
) -> Result<SecretAttributes>
[src]
&mut self,
context: &Secret
) -> Result<SecretAttributes>
fn secret_public_key_get(&mut self, context: &Secret) -> Result<PublicKey>
[src]
Extract public key from secret. Only Curve25519 type is supported
fn secret_destroy(&mut self, context: Secret) -> Result<()>
[src]
Remove secret from memory
impl Signer for SoftwareVault
[src]
impl Signer for SoftwareVault
[src]impl SymmetricVault for SoftwareVault
[src]
impl SymmetricVault for SoftwareVault
[src]impl Verifier for SoftwareVault
[src]
impl Verifier for SoftwareVault
[src]impl Zeroize for SoftwareVault
[src]
impl Zeroize for SoftwareVault
[src]Auto Trait Implementations
impl RefUnwindSafe for SoftwareVault
impl RefUnwindSafe for SoftwareVault
impl Send for SoftwareVault
impl Send for SoftwareVault
impl Sync for SoftwareVault
impl Sync for SoftwareVault
impl Unpin for SoftwareVault
impl Unpin for SoftwareVault
impl UnwindSafe for SoftwareVault
impl UnwindSafe for SoftwareVault
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,