mirror of
https://github.com/4sval/FModel.git
synced 2026-03-27 12:15:09 -05:00
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using J = Newtonsoft.Json.JsonPropertyAttribute;
|
|
using I = Newtonsoft.Json.JsonIgnoreAttribute;
|
|
|
|
namespace FModel.ViewModels.ApiEndpoints.Models;
|
|
|
|
[DebuggerDisplay("{" + nameof(Version) + "}")]
|
|
public class AesResponse
|
|
{
|
|
[I][J("version")] public string Version { get; private set; }
|
|
[J("mainKey")] public string MainKey { get; set; }
|
|
[J("dynamicKeys")] public List<DynamicKey> DynamicKeys { get; set; }
|
|
|
|
public AesResponse()
|
|
{
|
|
MainKey = string.Empty;
|
|
DynamicKeys = new List<DynamicKey>();
|
|
}
|
|
|
|
[I] public bool HasDynamicKeys => DynamicKeys is { Count: > 0 };
|
|
[I] public bool IsValid => MainKey.Length == 66 || HasDynamicKeys;
|
|
}
|
|
|
|
[DebuggerDisplay("{" + nameof(Key) + "}")]
|
|
public class DynamicKey
|
|
{
|
|
[J("name")] public string Name { get; set; }
|
|
[J("guid")] public string Guid { get; set; }
|
|
[J("key")] public string Key { get; set; }
|
|
|
|
[I] public bool IsValid => Guid.Length == 32 && Key.Length == 66;
|
|
}
|