bitwarden_crypto/keys/
user_key.rs

1use crate::{
2    rsa::{make_key_pair, RsaKeyPair},
3    Result, SymmetricCryptoKey,
4};
5
6/// User Key
7///
8/// The User Key is the symmetric encryption key used to decrypt the user's vault.
9pub struct UserKey(pub SymmetricCryptoKey);
10
11impl UserKey {
12    #[allow(missing_docs)]
13    pub fn new(key: SymmetricCryptoKey) -> Self {
14        Self(key)
15    }
16
17    #[allow(missing_docs)]
18    pub fn make_key_pair(&self) -> Result<RsaKeyPair> {
19        make_key_pair(&self.0)
20    }
21}