2017-06-22 22:14:51 -04:00
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
using System;
|
2017-06-22 09:09:51 -04:00
|
|
|
|
using System.Collections.Generic;
|
2017-06-22 17:03:35 -04:00
|
|
|
|
using u2flib.Util;
|
2017-06-06 17:15:19 -04:00
|
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Models
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TwoFactorProvider
|
|
|
|
|
|
{
|
|
|
|
|
|
public bool Enabled { get; set; }
|
2017-06-21 21:46:52 -04:00
|
|
|
|
public Dictionary<string, object> MetaData { get; set; } = new Dictionary<string, object>();
|
|
|
|
|
|
|
|
|
|
|
|
public class U2fMetaData
|
|
|
|
|
|
{
|
2017-06-22 22:14:51 -04:00
|
|
|
|
public U2fMetaData() { }
|
|
|
|
|
|
|
|
|
|
|
|
public U2fMetaData(dynamic o)
|
|
|
|
|
|
{
|
|
|
|
|
|
KeyHandle = o.KeyHandle;
|
|
|
|
|
|
PublicKey = o.PublicKey;
|
|
|
|
|
|
Certificate = o.Certificate;
|
|
|
|
|
|
Counter = o.Counter;
|
|
|
|
|
|
Compromised = o.Compromised;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-06-21 21:46:52 -04:00
|
|
|
|
public string KeyHandle { get; set; }
|
2017-06-22 22:14:51 -04:00
|
|
|
|
[JsonIgnore]
|
2017-06-22 09:09:51 -04:00
|
|
|
|
public byte[] KeyHandleBytes =>
|
|
|
|
|
|
string.IsNullOrWhiteSpace(KeyHandle) ? null : Utils.Base64StringToByteArray(KeyHandle);
|
2017-06-21 21:46:52 -04:00
|
|
|
|
public string PublicKey { get; set; }
|
2017-06-22 22:14:51 -04:00
|
|
|
|
[JsonIgnore]
|
2017-06-22 09:09:51 -04:00
|
|
|
|
public byte[] PublicKeyBytes =>
|
|
|
|
|
|
string.IsNullOrWhiteSpace(PublicKey) ? null : Utils.Base64StringToByteArray(PublicKey);
|
2017-06-21 21:46:52 -04:00
|
|
|
|
public string Certificate { get; set; }
|
2017-06-22 22:14:51 -04:00
|
|
|
|
[JsonIgnore]
|
2017-06-22 09:09:51 -04:00
|
|
|
|
public byte[] CertificateBytes =>
|
|
|
|
|
|
string.IsNullOrWhiteSpace(Certificate) ? null : Utils.Base64StringToByteArray(Certificate);
|
2017-06-21 22:33:45 -04:00
|
|
|
|
public uint Counter { get; set; }
|
2017-06-21 21:46:52 -04:00
|
|
|
|
public bool Compromised { get; set; }
|
|
|
|
|
|
}
|
2017-06-06 17:15:19 -04:00
|
|
|
|
}
|
|
|
|
|
|
}
|