1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use crate::vault::{KeyId, PublicKey, SecretAttributes, SecretKey};
use crate::Result;
use crate::{async_trait, compat::boxed::Box};
#[async_trait]
pub trait SecretVault {
async fn secret_generate(&self, attributes: SecretAttributes) -> Result<KeyId>;
async fn secret_import(&self, secret: &[u8], attributes: SecretAttributes) -> Result<KeyId>;
async fn secret_export(&self, key_id: &KeyId) -> Result<SecretKey>;
async fn secret_attributes_get(&self, key_id: &KeyId) -> Result<SecretAttributes>;
async fn secret_public_key_get(&self, key_id: &KeyId) -> Result<PublicKey>;
async fn secret_destroy(&self, key_id: KeyId) -> Result<()>;
}