diff --git a/crates/bitwarden-core/src/auth/mod.rs b/crates/bitwarden-core/src/auth/mod.rs index 6fe22bb57..30babdc7d 100644 --- a/crates/bitwarden-core/src/auth/mod.rs +++ b/crates/bitwarden-core/src/auth/mod.rs @@ -32,6 +32,8 @@ mod tde; pub use tde::RegisterTdeKeyResponse; #[cfg(feature = "internal")] mod key_connector; +#[cfg(feature = "internal")] +pub use key_connector::KeyConnectorResponse; #[cfg(feature = "internal")] use crate::error::Result; diff --git a/crates/bitwarden-uniffi/src/auth/mod.rs b/crates/bitwarden-uniffi/src/auth/mod.rs index 644580c5d..d036991e3 100644 --- a/crates/bitwarden-uniffi/src/auth/mod.rs +++ b/crates/bitwarden-uniffi/src/auth/mod.rs @@ -1,8 +1,11 @@ use std::sync::Arc; -use bitwarden::auth::{ - password::MasterPasswordPolicyOptions, AuthRequestResponse, RegisterKeyResponse, - RegisterTdeKeyResponse, +use bitwarden::{ + auth::{ + password::MasterPasswordPolicyOptions, AuthRequestResponse, KeyConnectorResponse, + RegisterKeyResponse, RegisterTdeKeyResponse, + }, + Error, }; use bitwarden_crypto::{AsymmetricEncString, EncString, HashPurpose, Kdf, TrustDeviceResponse}; @@ -79,6 +82,16 @@ impl ClientAuth { .make_register_tde_keys(email, org_public_key, remember_device)?) } + /// Generate keys needed to onboard a new user without master key to key connector + pub fn make_key_connector_keys(&self) -> Result { + Ok(self + .0 + .0 + .auth() + .make_key_connector_keys() + .map_err(Error::Crypto)?) + } + /// Validate the user password /// /// To retrieve the user's password hash, use [`ClientAuth::hash_password`] with