pub struct SoftwareVaultForSecureChannels { /* private fields */ }
Expand description

[SecureChannelVault] implementation using software

Implementations§

source§

impl SoftwareVaultForSecureChannels

source

pub fn new(storage: Arc<dyn KeyValueStorage<KeyId, StoredSecret>>) -> Self

Constructor

source

pub fn create() -> Arc<Self>

Create Software implementation Vault with [InMemoryKeyVaultStorage]

source§

impl SoftwareVaultForSecureChannels

source

pub async fn import_static_x25519_secret( &self, secret: X25519SecretKey ) -> Result<X25519SecretKeyHandle>

Import static X25519 Secret key.

source

pub fn get_secret_buffer(&self, handle: &SecretBufferHandle) -> Option<Vec<u8>>

Return Secret Buffer.

source

pub fn import_ephemeral_x25519_secret( &self, secret: X25519SecretKey ) -> X25519SecretKeyHandle

Import ephemeral X25519 Secret key.

source

pub async fn number_of_static_x25519_secrets(&self) -> Result<usize>

Return the total number of static x25519 secrets present in the Vault

source

pub fn number_of_ephemeral_x25519_secrets(&self) -> usize

Return the total number of ephemeral x25519 secrets present in the Vault

source

pub fn number_of_ephemeral_buffer_secrets(&self) -> usize

Return the total number of ephemeral buffer secrets present in the Vault

source

pub fn number_of_ephemeral_aead_secrets(&self) -> usize

Return the total number of ephemeral AEAD secrets present in the Vault

Trait Implementations§

source§

impl VaultForSecureChannels for SoftwareVaultForSecureChannels

source§

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
source§

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
source§

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
source§

fn aead_encrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 self, secret_key_handle: &'life1 AeadSecretKeyHandle, plain_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 encryption. [1]: http://www.noiseprotocol.org/noise.html#cipher-functions
source§

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
source§

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.
source§

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.
source§

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.
source§

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.
source§

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.
source§

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.
source§

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.
source§

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.
source§

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.
source§

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.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more