OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
ClearTextChannel.cs
1using System;
3
5{
16 internal sealed class ClearTextChannel : MessageSecureChannel
17 {
18 private const string NotSecuredMessage =
19 "Line quality test traffic is never secured; this channel has no cryptographic state.";
20
25 public static readonly ClearTextChannel Instance = new();
26
27 private ClearTextChannel()
28 {
29 }
30
31 public override byte[] DecodePayload(byte[] payload) => throw new NotSupportedException(NotSecuredMessage);
32
33 public override void EncodePayload(byte[] payload, Span<byte> destination) =>
34 throw new NotSupportedException(NotSecuredMessage);
35
36 public override ReadOnlySpan<byte> GenerateMac(ReadOnlySpan<byte> message, bool isIncoming) =>
37 throw new NotSupportedException(NotSecuredMessage);
38 }
39}