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 pub fn new(key: SymmetricCryptoKey) -> Self {
13 Self(key)
14 }
15
16 pub fn make_key_pair(&self) -> Result<RsaKeyPair> {
17 make_key_pair(&self.0)
18 }
19}