10 public SecurityInitialization(
byte[] serverRandomNumber,
bool isDefaultKey)
12 ServerRandomNumber = serverRandomNumber ??
throw new ArgumentNullException(nameof(serverRandomNumber));
13 IsDefaultKey = isDefaultKey;
16 public byte[] ServerRandomNumber {
get; }
18 public bool IsDefaultKey {
get; }
21 public override CommandType CommandType => CommandType.SessionChallenge;
24 public override byte Code => (byte)CommandType;
27 public override bool IsSecurityInitialization =>
true;
36 (
byte)(IsDefaultKey ? 0x00 : 0x01)
43 return ServerRandomNumber;
52 public static SecurityInitialization ParseData(ReadOnlySpan<byte> data, ReadOnlySpan<byte> securityControlBlock)
54 return new SecurityInitialization(data.ToArray(), securityControlBlock[2] == 0x01);
Base class representing a payload of a PD command message.
ReadOnlySpan< byte > SecurityControlBlock()
Retrieves the security control block for a specific command data type.
byte[] BuildData()
Converts the payload into a byte array to be sent over the wire.
SecurityBlockType
Security Block Type values as defined by OSDP protocol.