1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-15 07:43:37 +00:00

set org keys on login and decrypt org ciphers

This commit is contained in:
Kyle Spearrin
2017-04-20 11:23:30 -04:00
parent 490d1775a2
commit 18b2b6f447
17 changed files with 158 additions and 40 deletions

View File

@@ -10,14 +10,16 @@ namespace Bit.App.Abstractions
CryptoKey PreviousKey { get; }
bool KeyChanged { get; }
byte[] PrivateKey { get; }
IDictionary<Guid, CryptoKey> OrgKeys { get; set; }
IDictionary<string, CryptoKey> OrgKeys { get; set; }
void SetPrivateKey(CipherString privateKeyEnc, CryptoKey key);
CryptoKey GetOrgKey(Guid orgId);
void ClearOrgKey(Guid orgId);
CryptoKey GetOrgKey(string orgId);
void ClearOrgKey(string orgId);
void ClearKeys();
CryptoKey AddOrgKey(Guid orgId, CipherString encOrgKey, byte[] privateKey);
CryptoKey AddOrgKey(string orgId, CipherString encOrgKey, byte[] privateKey);
string Decrypt(CipherString encyptedValue, CryptoKey key = null);
byte[] DecryptToBytes(CipherString encyptedValue, CryptoKey key = null);
byte[] RsaDecryptToBytes(CipherString encyptedValue, byte[] privateKey);
CipherString Encrypt(string plaintextValue, CryptoKey key = null);
CryptoKey MakeKeyFromPassword(string password, string salt);
string MakeKeyFromPasswordBase64(string password, string salt);