Authority.cs
 1  namespace GUNRPG.Security;
 2  
 3  public sealed class Authority
 4  {
 5      private readonly byte[] _publicKey;
 6  
 7      public Authority(byte[] publicKey, string id)
 8      {
 9          _publicKey = AuthorityCrypto.CloneAndValidatePublicKey(publicKey);
10          Id = string.IsNullOrWhiteSpace(id)
11              ? throw new ArgumentException("Authority id must not be empty.", nameof(id))
12              : id;
13      }
14  
15      public byte[] PublicKey => (byte[])_publicKey.Clone();
16  
17      internal byte[] PublicKeyBytes => _publicKey;
18  
19      public string Id { get; }
20  }