Esempio n. 1
0
        protected override async Task <Memory <byte> > GetRfpaAsync(CryptedRfpConnection connection, CancellationToken cancellationToken)
        {
            using (var reader = new OmmConfReader(_ommConf))
            {
                var rfp = await reader.GetValueAsync("RFP", "mac", connection.Identifier.ToString().ToUpper(), cancellationToken).ConfigureAwait(false);

                if (rfp is null)
                {
                    return(Memory <byte> .Empty);
                }
                var id   = rfp["id"];
                var rfpa = await reader.GetValueAsync("RFPA", "id", id, cancellationToken).ConfigureAwait(false);

                if (rfpa is null)
                {
                    return(Memory <byte> .Empty);
                }
                var key = rfpa[1];
                return(HexEncoding.HexToByte(key));
            }
        }
Esempio n. 2
0
 protected override void OnClientDisconnected(CryptedRfpConnection client)
 {
     _connections.TryRemove(client.Identifier, out _);
 }