OSDP.Net 5.2.1
A .NET library for implementing the Open Supervised Device Protocol (OSDP)
Loading...
Searching...
No Matches
IMessageSecureChannel.cs
1using System;
2
4
8public interface IMessageSecureChannel
9{
15
22 public bool IsInitialized { get; }
23
27 public byte[] ServerRandomNumber { get; }
28
35 public byte[] ServerCryptogram { get; }
36
40 public bool IsUsingDefaultKey { get; }
41
52 void EncodePayload(byte[] payload, Span<byte> destination);
53
66 byte[] DecodePayload(byte[] payload);
67
78 ReadOnlySpan<byte> GenerateMac(ReadOnlySpan<byte> message, bool isIncoming);
79
85 void InitializeACU(byte[] clientRandomNumber, byte[] clientCryptogram);
86
91
96 void Establish(byte[] rmac);
97
103 ReadOnlySpan<byte> PadTheData(ReadOnlySpan<byte> payload);
104}
Represents the secure channel context within which a message is packed/unpacked.
byte[] ServerRandomNumber
Represents the server random number used in the secure channel context.
bool IsInitialized
Gets a value indicating whether the secure channel is initialized.
bool IsUsingDefaultKey
Gets a value indicating whether the secure channel is using the default key.
void Establish(byte[] rmac)
Establishes the secure channel with the provided RMAC.
ReadOnlySpan< byte > GenerateMac(ReadOnlySpan< byte > message, bool isIncoming)
Generates a new Message Authentication Code.
void EncodePayload(byte[] payload, Span< byte > destination)
Encrypts the payload using the secure channel context.
void InitializeACU(byte[] clientRandomNumber, byte[] clientCryptogram)
Initializes the Access Control Unit (ACU) in the secure channel context.
byte[] ServerCryptogram
Represents the secure channel cryptogram used by the server.
byte[] DecodePayload(byte[] payload)
Decodes the payload using the secure channel context.
bool IsSecurityEstablished
Indicates whether or not a secure channel has been established on the current message channel.
void ResetSecureChannelSession()
Resets the secure channel session by creating a new random number.
ReadOnlySpan< byte > PadTheData(ReadOnlySpan< byte > payload)
Pads the given data with padding bytes to make it a multiple of a specified length.