pub struct AsyncCryptoSystemGuard<'a> { /* private fields */ }Expand description
Async cryptosystem guard to help break up heavy blocking operations
Implementations§
Source§impl AsyncCryptoSystemGuard<'_>
impl AsyncCryptoSystemGuard<'_>
pub fn kind(&self) -> CryptoKind
pub fn crypto(&self) -> VeilidComponentGuard<'_, Crypto>
pub async fn cached_dh( &self, key: &PublicKey, secret: &SecretKey, ) -> VeilidAPIResult<SharedSecret>
pub async fn random_bytes(&self, len: usize) -> Vec<u8> ⓘ
pub async fn hash_password( &self, password: &[u8], salt: &[u8], ) -> VeilidAPIResult<String>
pub async fn verify_password( &self, password: &[u8], password_hash: &str, ) -> VeilidAPIResult<bool>
pub async fn random_nonce(&self) -> Nonce
pub async fn compute_dh( &self, key: &PublicKey, secret: &SecretKey, ) -> VeilidAPIResult<SharedSecret>
pub async fn generate_keypair(&self) -> KeyPair
pub async fn generate_hash(&self, data: &[u8]) -> HashDigest
pub async fn generate_hash_reader( &self, reader: &mut dyn Read, ) -> VeilidAPIResult<PublicKey>
pub fn nonce_length(&self) -> usize
pub fn hash_digest_length(&self) -> usize
pub fn public_key_length(&self) -> usize
pub fn secret_key_length(&self) -> usize
pub fn signature_length(&self) -> usize
pub fn aead_overhead(&self) -> usize
pub fn default_salt_length(&self) -> usize
pub fn check_nonce(&self, nonce: &Nonce) -> VeilidAPIResult<()>
pub fn check_hash_digest(&self, hash: &HashDigest) -> VeilidAPIResult<()>
pub fn check_public_key(&self, key: &PublicKey) -> VeilidAPIResult<()>
pub fn check_secret_key(&self, key: &SecretKey) -> VeilidAPIResult<()>
pub fn check_signature(&self, signature: &Signature) -> VeilidAPIResult<()>
pub async fn validate_keypair( &self, key: &PublicKey, secret: &SecretKey, ) -> VeilidAPIResult<bool>
pub async fn validate_hash( &self, data: &[u8], hash: &HashDigest, ) -> VeilidAPIResult<bool>
pub async fn validate_hash_reader( &self, reader: &mut dyn Read, hash: &HashDigest, ) -> VeilidAPIResult<bool>
pub async fn sign( &self, key: &PublicKey, secret: &SecretKey, data: &[u8], ) -> VeilidAPIResult<Signature>
pub async fn verify( &self, key: &PublicKey, data: &[u8], signature: &Signature, ) -> VeilidAPIResult<bool>
pub async fn decrypt_in_place_aead( &self, body: &mut Vec<u8>, nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]>, ) -> VeilidAPIResult<()>
pub async fn decrypt_aead( &self, body: &[u8], nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]>, ) -> VeilidAPIResult<Vec<u8>>
pub async fn encrypt_in_place_aead( &self, body: &mut Vec<u8>, nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]>, ) -> VeilidAPIResult<()>
pub async fn encrypt_aead( &self, body: &[u8], nonce: &Nonce, shared_secret: &SharedSecret, associated_data: Option<&[u8]>, ) -> VeilidAPIResult<Vec<u8>>
pub async fn crypt_in_place_no_auth( &self, body: &mut [u8], nonce: &Nonce, shared_secret: &SharedSecret, ) -> VeilidAPIResult<()>
pub async fn crypt_b2b_no_auth( &self, in_buf: &[u8], out_buf: &mut [u8], nonce: &Nonce, shared_secret: &SharedSecret, ) -> VeilidAPIResult<()>
pub async fn crypt_no_auth_aligned_8( &self, body: &[u8], nonce: &Nonce, shared_secret: &SharedSecret, ) -> VeilidAPIResult<Vec<u8>>
pub async fn crypt_no_auth_unaligned( &self, body: &[u8], nonce: &Nonce, shared_secret: &SharedSecret, ) -> VeilidAPIResult<Vec<u8>>
Auto Trait Implementations§
impl<'a> Freeze for AsyncCryptoSystemGuard<'a>
impl<'a> !RefUnwindSafe for AsyncCryptoSystemGuard<'a>
impl<'a> Send for AsyncCryptoSystemGuard<'a>
impl<'a> Sync for AsyncCryptoSystemGuard<'a>
impl<'a> Unpin for AsyncCryptoSystemGuard<'a>
impl<'a> !UnwindSafe for AsyncCryptoSystemGuard<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more