Struct veilid_core::Crypto
source · pub struct Crypto { /* private fields */ }
Expand description
Crypto factory implementation
Implementations§
source§impl Crypto
impl Crypto
pub fn new(config: VeilidConfig, table_store: TableStore) -> Self
pub fn config(&self) -> VeilidConfig
pub async fn init(&self) -> EyreResult<()>
pub async fn flush(&self) -> EyreResult<()>
pub async fn terminate(&self)
sourcepub fn get(&self, kind: CryptoKind) -> Option<CryptoSystemVersion>
pub fn get(&self, kind: CryptoKind) -> Option<CryptoSystemVersion>
Factory method to get a specific crypto version
pub fn best(&self) -> CryptoSystemVersion
sourcepub fn verify_signatures(
&self,
node_ids: &[TypedKey],
data: &[u8],
typed_signatures: &[TypedSignature]
) -> VeilidAPIResult<TypedKeyGroup>
pub fn verify_signatures( &self, node_ids: &[TypedKey], data: &[u8], typed_signatures: &[TypedSignature] ) -> VeilidAPIResult<TypedKeyGroup>
Signature set verification Returns the set of signature cryptokinds that validate and are supported If any cryptokinds are supported and do not validate, the whole operation returns an error
sourcepub fn generate_signatures<F, R>(
&self,
data: &[u8],
typed_key_pairs: &[TypedKeyPair],
transform: F
) -> VeilidAPIResult<Vec<R>>
pub fn generate_signatures<F, R>( &self, data: &[u8], typed_key_pairs: &[TypedKeyPair], transform: F ) -> VeilidAPIResult<Vec<R>>
Signature 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<TypedKeyPair>
pub fn generate_keypair( crypto_kind: CryptoKind ) -> VeilidAPIResult<TypedKeyPair>
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