Struct ockam_vault_sync_core::VaultMutex
source · [−]pub struct VaultMutex<V>(_);
Expand description
Vault inside Arc Mutex
Implementations
sourceimpl<V> VaultMutex<V>
impl<V> VaultMutex<V>
Trait Implementations
sourceimpl<V: AsymmetricVault + Send> AsymmetricVault for VaultMutex<V>
impl<V: AsymmetricVault + Send> AsymmetricVault for VaultMutex<V>
sourcefn ec_diffie_hellman<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret,
peer_public_key: &'life2 PublicKey
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn ec_diffie_hellman<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret,
peer_public_key: &'life2 PublicKey
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Compute Elliptic-Curve Diffie-Hellman using this secret key and the specified uncompressed public key. Read more
sourceimpl<V> Clone for VaultMutex<V>
impl<V> Clone for VaultMutex<V>
sourceimpl<V: Hasher + Send> Hasher for VaultMutex<V>
impl<V: Hasher + Send> Hasher for VaultMutex<V>
sourcefn sha256<'life0, 'life1, 'async_trait>(
&'life0 mut self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<[u8; 32]>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sha256<'life0, 'life1, 'async_trait>(
&'life0 mut self,
data: &'life1 [u8]
) -> Pin<Box<dyn Future<Output = Result<[u8; 32]>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Compute the SHA-256 digest given input data
.
sourcefn hkdf_sha256<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
salt: &'life1 Secret,
info: &'life2 [u8],
ikm: Option<&'life3 Secret>,
output_attributes: SmallBuffer<SecretAttributes>
) -> Pin<Box<dyn Future<Output = Result<SmallBuffer<Secret>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn hkdf_sha256<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
salt: &'life1 Secret,
info: &'life2 [u8],
ikm: Option<&'life3 Secret>,
output_attributes: SmallBuffer<SecretAttributes>
) -> Pin<Box<dyn Future<Output = Result<SmallBuffer<Secret>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
sourceimpl<V: KeyIdVault + Send> KeyIdVault for VaultMutex<V>
impl<V: KeyIdVault + Send> KeyIdVault for VaultMutex<V>
sourcefn secret_by_key_id<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key_id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn secret_by_key_id<'life0, 'life1, 'async_trait>(
&'life0 mut self,
key_id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Return the Secret
for a given key id.
sourcefn compute_key_id_for_public_key<'life0, 'life1, 'async_trait>(
&'life0 mut self,
public_key: &'life1 PublicKey
) -> Pin<Box<dyn Future<Output = Result<KeyId>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn compute_key_id_for_public_key<'life0, 'life1, 'async_trait>(
&'life0 mut self,
public_key: &'life1 PublicKey
) -> Pin<Box<dyn Future<Output = Result<KeyId>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Compute and return the KeyId
for a given public key.
sourceimpl<V: SecretVault + Send> SecretVault for VaultMutex<V>
impl<V: SecretVault + Send> SecretVault for VaultMutex<V>
sourcefn secret_generate<'life0, 'async_trait>(
&'life0 mut self,
attributes: SecretAttributes
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn secret_generate<'life0, 'async_trait>(
&'life0 mut self,
attributes: SecretAttributes
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Generate a fresh secret with the given attributes.
sourcefn secret_import<'life0, 'life1, 'async_trait>(
&'life0 mut self,
secret: &'life1 [u8],
attributes: SecretAttributes
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn secret_import<'life0, 'life1, 'async_trait>(
&'life0 mut self,
secret: &'life1 [u8],
attributes: SecretAttributes
) -> Pin<Box<dyn Future<Output = Result<Secret>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Import a secret with the given attributes from binary form into the vault.
sourcefn secret_export<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret
) -> Pin<Box<dyn Future<Output = Result<SecretKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn secret_export<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret
) -> Pin<Box<dyn Future<Output = Result<SecretKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Export a secret key to the binary form represented as SecretKey
.
sourcefn secret_attributes_get<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret
) -> Pin<Box<dyn Future<Output = Result<SecretAttributes>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn secret_attributes_get<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret
) -> Pin<Box<dyn Future<Output = Result<SecretAttributes>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Return the attributes for a secret.
sourcefn secret_public_key_get<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn secret_public_key_get<'life0, 'life1, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Return the associated public key given the secret key.
sourceimpl<V: Signer + Send> Signer for VaultMutex<V>
impl<V: Signer + Send> Signer for VaultMutex<V>
sourcefn sign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
secret_key: &'life1 Secret,
data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn sign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
secret_key: &'life1 Secret,
data: &'life2 [u8]
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Generate a Signature
for the given data using the given Secret
key.
sourceimpl<V: SymmetricVault + Send> SymmetricVault for VaultMutex<V>
impl<V: SymmetricVault + Send> SymmetricVault for VaultMutex<V>
sourcefn aead_aes_gcm_encrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret,
plaintext: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Buffer<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn aead_aes_gcm_encrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret,
plaintext: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Buffer<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Encrypt a payload using AES-GCM.
sourcefn aead_aes_gcm_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret,
cipher_text: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Buffer<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn aead_aes_gcm_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 mut self,
context: &'life1 Secret,
cipher_text: &'life2 [u8],
nonce: &'life3 [u8],
aad: &'life4 [u8]
) -> Pin<Box<dyn Future<Output = Result<Buffer<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Decrypt a payload using AES-GCM.
sourceimpl<V: Verifier + Send> Verifier for VaultMutex<V>
impl<V: Verifier + Send> Verifier for VaultMutex<V>
sourcefn verify<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
signature: &'life1 Signature,
public_key: &'life2 PublicKey,
data: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn verify<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 mut self,
signature: &'life1 Signature,
public_key: &'life2 PublicKey,
data: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Verify a signature for the given data using the given public key.
Auto Trait Implementations
impl<V> !RefUnwindSafe for VaultMutex<V>
impl<V> Send for VaultMutex<V> where
V: Send,
impl<V> Sync for VaultMutex<V> where
V: Send,
impl<V> Unpin for VaultMutex<V>
impl<V> !UnwindSafe for VaultMutex<V>
Blanket Implementations
sourceimpl<D> AsyncTryClone for D where
D: Clone + Sync,
impl<D> AsyncTryClone for D where
D: Clone + Sync,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more