Trait ockam_vault::VaultForSecureChannels
source · pub trait VaultForSecureChannels: Send + Sync + 'static {
Show 15 methods
// Required methods
fn x25519_ecdh<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 X25519SecretKeyHandle,
peer_public_key: &'life2 X25519PublicKey
) -> Pin<Box<dyn Future<Output = Result<SecretBufferHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn hash<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<HashOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn hkdf<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
salt: &'life1 SecretBufferHandle,
input_key_material: Option<&'life2 SecretBufferHandle>,
number_of_outputs: HKDFNumberOfOutputs
) -> Pin<Box<dyn Future<Output = Result<HkdfOutput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn aead_encrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
destination: &'life1 mut Vec<u8>,
secret_key_handle: &'life2 AeadSecretKeyHandle,
plain_text: &'life3 [u8],
nonce: &'life4 [u8],
aad: &'life5 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait;
fn aead_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 AeadSecretKeyHandle,
cipher_text: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn generate_static_x25519_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_static_x25519_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn generate_ephemeral_x25519_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_ephemeral_x25519_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_x25519_public_key<'life0, 'life1, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<X25519PublicKey>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_x25519_secret_key_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
public_key: &'life1 X25519PublicKey
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn import_secret_buffer<'life0, 'async_trait>(
&'life0 self,
buffer: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<SecretBufferHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_secret_buffer<'life0, 'async_trait>(
&'life0 self,
secret_buffer_handle: SecretBufferHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn convert_secret_buffer_to_aead_key<'life0, 'async_trait>(
&'life0 self,
secret_buffer_handle: SecretBufferHandle
) -> Pin<Box<dyn Future<Output = Result<AeadSecretKeyHandle>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_aead_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: AeadSecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Vault for running a Secure Channel
Required Methods§
sourcefn x25519_ecdh<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 X25519SecretKeyHandle,
peer_public_key: &'life2 X25519PublicKey
) -> Pin<Box<dyn Future<Output = Result<SecretBufferHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn x25519_ecdh<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 X25519SecretKeyHandle,
peer_public_key: &'life2 X25519PublicKey
) -> Pin<Box<dyn Future<Output = Result<SecretBufferHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Perform X25519 ECDH. [1]: http://www.noiseprotocol.org/noise.html#dh-functions
sourcefn hash<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<HashOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn hash<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<HashOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Compute Hash. [1]: http://www.noiseprotocol.org/noise.html#hash-functions
sourcefn hkdf<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
salt: &'life1 SecretBufferHandle,
input_key_material: Option<&'life2 SecretBufferHandle>,
number_of_outputs: HKDFNumberOfOutputs
) -> Pin<Box<dyn Future<Output = Result<HkdfOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn hkdf<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
salt: &'life1 SecretBufferHandle,
input_key_material: Option<&'life2 SecretBufferHandle>,
number_of_outputs: HKDFNumberOfOutputs
) -> Pin<Box<dyn Future<Output = Result<HkdfOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compute HKDF. [1]: http://www.noiseprotocol.org/noise.html#hash-functions
sourcefn aead_encrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
destination: &'life1 mut Vec<u8>,
secret_key_handle: &'life2 AeadSecretKeyHandle,
plain_text: &'life3 [u8],
nonce: &'life4 [u8],
aad: &'life5 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn aead_encrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
destination: &'life1 mut Vec<u8>,
secret_key_handle: &'life2 AeadSecretKeyHandle,
plain_text: &'life3 [u8],
nonce: &'life4 [u8],
aad: &'life5 [u8]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Perform AEAD encryption. [1]: http://www.noiseprotocol.org/noise.html#cipher-functions
sourcefn aead_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 AeadSecretKeyHandle,
cipher_text: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn aead_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 AeadSecretKeyHandle,
cipher_text: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Perform AEAD decryption. [1]: http://www.noiseprotocol.org/noise.html#cipher-functions
sourcefn generate_static_x25519_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_static_x25519_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a fresh static (persisted) X25519 Key.
sourcefn delete_static_x25519_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_static_x25519_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete static X25519 Key.
sourcefn generate_ephemeral_x25519_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_ephemeral_x25519_secret_key<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a fresh ephemeral (not persisted) X25519 Key.
sourcefn delete_ephemeral_x25519_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_ephemeral_x25519_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete ephemeral X25519 Key.
sourcefn get_x25519_public_key<'life0, 'life1, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<X25519PublicKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_x25519_public_key<'life0, 'life1, 'async_trait>(
&'life0 self,
secret_key_handle: &'life1 X25519SecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<X25519PublicKey>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get X25519PublicKey
of the corresponding X25519 Secret Key given its Handle.
sourcefn get_x25519_secret_key_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
public_key: &'life1 X25519PublicKey
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_x25519_secret_key_handle<'life0, 'life1, 'async_trait>(
&'life0 self,
public_key: &'life1 X25519PublicKey
) -> Pin<Box<dyn Future<Output = Result<X25519SecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get Handle to a X25519 Secret Key given its X25519PublicKey
.
sourcefn import_secret_buffer<'life0, 'async_trait>(
&'life0 self,
buffer: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<SecretBufferHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn import_secret_buffer<'life0, 'async_trait>(
&'life0 self,
buffer: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<SecretBufferHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Import a Secret Buffer.
sourcefn delete_secret_buffer<'life0, 'async_trait>(
&'life0 self,
secret_buffer_handle: SecretBufferHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_secret_buffer<'life0, 'async_trait>(
&'life0 self,
secret_buffer_handle: SecretBufferHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete Secret Buffer.
sourcefn convert_secret_buffer_to_aead_key<'life0, 'async_trait>(
&'life0 self,
secret_buffer_handle: SecretBufferHandle
) -> Pin<Box<dyn Future<Output = Result<AeadSecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn convert_secret_buffer_to_aead_key<'life0, 'async_trait>(
&'life0 self,
secret_buffer_handle: SecretBufferHandle
) -> Pin<Box<dyn Future<Output = Result<AeadSecretKeyHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Convert a Secret Buffer to an AEAD Key.
sourcefn delete_aead_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: AeadSecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_aead_secret_key<'life0, 'async_trait>(
&'life0 self,
secret_key_handle: AeadSecretKeyHandle
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete AEAD Key.