From 2db787de45525986bc64485b7de20b49dab66865 Mon Sep 17 00:00:00 2001 From: Thomas Avery Date: Mon, 14 Oct 2024 11:38:20 -0500 Subject: [PATCH] Add methods to wasm-internal --- crates/bitwarden-wasm-internal/src/crypto.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/crates/bitwarden-wasm-internal/src/crypto.rs b/crates/bitwarden-wasm-internal/src/crypto.rs index f1b581964..dc6d8fdc9 100644 --- a/crates/bitwarden-wasm-internal/src/crypto.rs +++ b/crates/bitwarden-wasm-internal/src/crypto.rs @@ -1,7 +1,10 @@ use std::rc::Rc; use bitwarden_core::{ - mobile::crypto::{InitOrgCryptoRequest, InitUserCryptoRequest}, + mobile::crypto::{ + InitOrgCryptoRequest, InitUserCryptoRequest, MakeKeyPairResponse, + VerifyAsymmetricKeysRequest, VerifyAsymmetricKeysResponse, + }, Client, }; use wasm_bindgen::prelude::*; @@ -30,4 +33,15 @@ impl ClientCrypto { pub async fn initialize_org_crypto(&self, req: InitOrgCryptoRequest) -> Result<()> { Ok(self.0.crypto().initialize_org_crypto(req).await?) } + + pub fn make_key_pair(&self) -> Result { + Ok(self.0.crypto().make_key_pair()?) + } + + pub fn verify_asymmetric_keys( + &self, + request: VerifyAsymmetricKeysRequest, + ) -> Result { + Ok(self.0.crypto().verify_asymmetric_keys(request)?) + } }