pub struct Crypto { /* private fields */ }Expand description
Crypto factory implementation
Implementations§
Source§impl Crypto
impl Crypto
pub async fn flush(&self) -> EyreResult<()>
Sourcepub fn get(&self, kind: CryptoKind) -> Option<CryptoSystemGuard<'_>>
pub fn get(&self, kind: CryptoKind) -> Option<CryptoSystemGuard<'_>>
Factory method to get a specific crypto version
Sourcepub fn get_async(&self, kind: CryptoKind) -> Option<AsyncCryptoSystemGuard<'_>>
pub fn get_async(&self, kind: CryptoKind) -> Option<AsyncCryptoSystemGuard<'_>>
Factory method to get a specific crypto version for async use
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 fn check_keypair(&self, key_pair: &KeyPair) -> VeilidAPIResult<()>
Sourcepub fn verify_signatures(
&self,
public_keys: &[PublicKey],
data: &[u8],
signatures: &[Signature],
) -> VeilidAPIResult<Option<PublicKeyGroup>>
pub fn verify_signatures( &self, public_keys: &[PublicKey], data: &[u8], signatures: &[Signature], ) -> VeilidAPIResult<Option<PublicKeyGroup>>
BareSignature set verification Returns Some() the set of signature cryptokinds that validate and are supported Returns None if any cryptokinds are supported and do not validate
Sourcepub fn generate_signatures<F, R>(
&self,
data: &[u8],
key_pairs: &[KeyPair],
transform: F,
) -> VeilidAPIResult<Vec<R>>
pub fn generate_signatures<F, R>( &self, data: &[u8], key_pairs: &[KeyPair], transform: F, ) -> VeilidAPIResult<Vec<R>>
BareSignature set generation Generates the set of signatures that are supported Any cryptokinds that are not supported are silently dropped
Sourcepub fn generate_keypair(crypto_kind: CryptoKind) -> VeilidAPIResult<KeyPair>
pub fn generate_keypair(crypto_kind: CryptoKind) -> VeilidAPIResult<KeyPair>
Generate keypair Does not require startup/init
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Crypto
impl !RefUnwindSafe for Crypto
impl Send for Crypto
impl Sync for Crypto
impl Unpin for Crypto
impl !UnwindSafe for Crypto
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