mirror of
https://github.com/bitwarden/mobile.git
synced 2024-06-28 10:54:59 +02:00
* Use CipherByteArray to signify encrypted byte[] * Rename CipherString and CipherByteArray to EncString and EncByteArray
41 lines
1.1 KiB
C#
41 lines
1.1 KiB
C#
using Bit.Core.Models.Data;
|
|
using Bit.Core.Models.View;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Bit.Core.Models.Domain
|
|
{
|
|
public class PasswordHistory : Domain
|
|
{
|
|
private HashSet<string> _map = new HashSet<string>
|
|
{
|
|
"Password"
|
|
};
|
|
|
|
public PasswordHistory() { }
|
|
|
|
public PasswordHistory(PasswordHistoryData obj, bool alreadyEncrypted = false)
|
|
{
|
|
BuildDomainModel(this, obj, _map, alreadyEncrypted);
|
|
LastUsedDate = obj.LastUsedDate.GetValueOrDefault();
|
|
}
|
|
|
|
public EncString Password { get; set; }
|
|
public DateTime LastUsedDate { get; set; }
|
|
|
|
public Task<PasswordHistoryView> DecryptAsync(string orgId)
|
|
{
|
|
return DecryptObjAsync(new PasswordHistoryView(this), this, _map, orgId);
|
|
}
|
|
|
|
public PasswordHistoryData ToPasswordHistoryData()
|
|
{
|
|
var ph = new PasswordHistoryData();
|
|
ph.LastUsedDate = LastUsedDate;
|
|
BuildDataModel(this, ph, _map);
|
|
return ph;
|
|
}
|
|
}
|
|
}
|