Class MavlinkSigner
A signing key and the monotonic timestamp that goes with it.
public sealed class MavlinkSigner : IDisposable
- Inheritance
-
MavlinkSigner
- Implements
- Inherited Members
Constructors
MavlinkSigner(ReadOnlySpan<byte>, byte, ulong)
Creates a signer.
public MavlinkSigner(ReadOnlySpan<byte> key, byte linkId = 0, ulong timestamp = 0)
Parameters
keyReadOnlySpan<byte>The shared signing key, KeyLength bytes.
linkIdbyteWhich link this sender signs on.
timestampulongThe timestamp to start from.
Remarks
The link id separates two links from one system, so traffic on one does not look like a replay of the other.
Exceptions
- ArgumentException
The key is the wrong length.
Properties
LinkId
Which link this signer signs on.
public byte LinkId { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Sign(MavlinkHeader, uint, ReadOnlySpan<byte>, byte)
Signs a message into a v2 frame.
public MavlinkFrame Sign(MavlinkHeader header, uint msgid, ReadOnlySpan<byte> payload, byte crcExtra)
Parameters
headerMavlinkHeaderThe addressing fields to stamp on the frame.
msgiduintThe message id.
payloadReadOnlySpan<byte>The message payload.
crcExtrabyteThe seed for this message id.
Returns
- MavlinkFrame
The signed frame.
Remarks
Each call advances the timestamp, which is what makes a replayed frame detectable.
Exceptions
- PamojaException
The payload does not fit a frame.