1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-16 08:14:01 +00:00

settings adjustments to allow sharing with service

This commit is contained in:
Kyle Spearrin
2017-05-16 16:28:11 -04:00
parent 7f332986de
commit fef92f6245
5 changed files with 21 additions and 16 deletions

View File

@@ -14,14 +14,14 @@ namespace Bit.Core.Models
public EncryptedData(byte[] plainValue)
{
IV = RandomBytes();
Value = ProtectedData.Protect(plainValue, IV, DataProtectionScope.CurrentUser);
Value = ProtectedData.Protect(plainValue, IV, DataProtectionScope.LocalMachine);
}
public EncryptedData(string plainValue)
{
var bytes = Encoding.UTF8.GetBytes(plainValue);
IV = RandomBytes();
Value = ProtectedData.Protect(bytes, IV, DataProtectionScope.CurrentUser);
Value = ProtectedData.Protect(bytes, IV, DataProtectionScope.LocalMachine);
}
public byte[] Value { get; set; }