mirror of
https://github.com/bitwarden/mobile
synced 2025-12-16 08:13:20 +00:00
[PM-4054] Rename Fido2Key to Fido2Credential (#2821)
* PM-4054 Renamed Fido2Key to Fido2Credential on the entire codebase * PM-4054 Renamed file Fido2KeyApi to Fido2CredentialApi
This commit is contained in:
committed by
GitHub
parent
bb2f1f0f5f
commit
f2936c95fa
56
src/Core/Models/Domain/Fido2Credential.cs
Normal file
56
src/Core/Models/Domain/Fido2Credential.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Models.Data;
|
||||
using Bit.Core.Models.View;
|
||||
|
||||
namespace Bit.Core.Models.Domain
|
||||
{
|
||||
public class Fido2Credential : Domain
|
||||
{
|
||||
public static HashSet<string> EncryptableProperties => new HashSet<string>
|
||||
{
|
||||
nameof(CredentialId),
|
||||
nameof(Discoverable),
|
||||
nameof(KeyType),
|
||||
nameof(KeyAlgorithm),
|
||||
nameof(KeyCurve),
|
||||
nameof(KeyValue),
|
||||
nameof(RpId),
|
||||
nameof(RpName),
|
||||
nameof(UserHandle),
|
||||
nameof(UserName),
|
||||
nameof(Counter)
|
||||
};
|
||||
|
||||
public Fido2Credential() { }
|
||||
|
||||
public Fido2Credential(Fido2CredentialData data, bool alreadyEncrypted = false)
|
||||
{
|
||||
BuildDomainModel(this, data, EncryptableProperties, alreadyEncrypted);
|
||||
}
|
||||
|
||||
public EncString CredentialId { get; set; }
|
||||
public EncString Discoverable { get; set; }
|
||||
public EncString KeyType { get; set; }
|
||||
public EncString KeyAlgorithm { get; set; }
|
||||
public EncString KeyCurve { get; set; }
|
||||
public EncString KeyValue { get; set; }
|
||||
public EncString RpId { get; set; }
|
||||
public EncString RpName { get; set; }
|
||||
public EncString UserHandle { get; set; }
|
||||
public EncString UserName { get; set; }
|
||||
public EncString Counter { get; set; }
|
||||
|
||||
public async Task<Fido2CredentialView> DecryptAsync(string orgId, SymmetricCryptoKey key = null)
|
||||
{
|
||||
return await DecryptObjAsync(new Fido2CredentialView(), this, EncryptableProperties, orgId, key);
|
||||
}
|
||||
|
||||
public Fido2CredentialData ToFido2CredentialData()
|
||||
{
|
||||
var data = new Fido2CredentialData();
|
||||
BuildDataModel(this, data, EncryptableProperties);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user