Skip to content

Commit

Permalink
Add methods to wasm-internal
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery committed Oct 14, 2024
1 parent c3be870 commit 2db787d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion crates/bitwarden-wasm-internal/src/crypto.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down Expand Up @@ -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<MakeKeyPairResponse> {
Ok(self.0.crypto().make_key_pair()?)
}

Check warning on line 39 in crates/bitwarden-wasm-internal/src/crypto.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm-internal/src/crypto.rs#L37-L39

Added lines #L37 - L39 were not covered by tests

pub fn verify_asymmetric_keys(
&self,
request: VerifyAsymmetricKeysRequest,
) -> Result<VerifyAsymmetricKeysResponse> {
Ok(self.0.crypto().verify_asymmetric_keys(request)?)
}

Check warning on line 46 in crates/bitwarden-wasm-internal/src/crypto.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-wasm-internal/src/crypto.rs#L41-L46

Added lines #L41 - L46 were not covered by tests
}

0 comments on commit 2db787d

Please sign in to comment.