1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-19 17:53:47 +00:00

extend crypto service for org keys

This commit is contained in:
Kyle Spearrin
2017-04-20 10:20:24 -04:00
parent 4c2bcb9e6b
commit 58c5c55d09
2 changed files with 104 additions and 14 deletions

View File

@@ -1,4 +1,6 @@
using Bit.App.Models;
using System;
using System.Collections.Generic;
namespace Bit.App.Abstractions
{
@@ -7,7 +9,14 @@ namespace Bit.App.Abstractions
CryptoKey Key { get; set; }
CryptoKey PreviousKey { get; }
bool KeyChanged { get; }
byte[] PrivateKey { get; set; }
IDictionary<Guid, CryptoKey> OrgKeys { get; set; }
void SetPrivateKey(CipherString privateKeyEnc, CryptoKey key);
CryptoKey GetOrgKey(Guid orgId);
void ClearOrgKey(Guid orgId);
void ClearKeys();
CryptoKey AddOrgKey(Guid orgId, CipherString encOrgKey, byte[] privateKey);
string Decrypt(CipherString encyptedValue, CryptoKey key = null);
CipherString Encrypt(string plaintextValue, CryptoKey key = null);
CryptoKey MakeKeyFromPassword(string password, string salt);