Skip to content

Commit

Permalink
Add code comments to public API.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery committed Oct 16, 2024
1 parent 2db787d commit e9d4fc2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/bitwarden-wasm-internal/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ impl ClientCrypto {
Ok(self.0.crypto().initialize_org_crypto(req).await?)
}

/// Generates a new key pair and encrypts the private key with the initialized user key.
/// Needs to be called after `initialize_user_crypto`.
pub fn make_key_pair(&self) -> Result<MakeKeyPairResponse> {
Ok(self.0.crypto().make_key_pair()?)
}

/// Verifies a user's asymmetric keys by decrypting the private key with the initialized user
/// key. Returns if the private key is decryptable and if it is a valid matching key.
/// Needs to be called after `initialize_user_crypto`.
pub fn verify_asymmetric_keys(
&self,
request: VerifyAsymmetricKeysRequest,
Expand Down

0 comments on commit e9d4fc2

Please sign in to comment.