Struct sbp::messages::signing::msg_ecdsa_signature::MsgEcdsaSignature
source · pub struct MsgEcdsaSignature {
pub sender_id: Option<u16>,
pub flags: u8,
pub stream_counter: u8,
pub on_demand_counter: u8,
pub certificate_id: [u8; 4],
pub signature: ECDSASignature,
pub signed_messages: Vec<u8>,
}
Expand description
An ECDSA signature
An ECDSA-256 signature using SHA-256 as the message digest algorithm.
Fields§
§sender_id: Option<u16>
The message sender_id
flags: u8
Describes the format of the signed\_messages
field below.
stream_counter: u8
Signature message counter. Zero indexed and incremented with each signature message. The counter will not increment if this message was in response to an on demand request. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero.
on_demand_counter: u8
On demand message counter. Zero indexed and incremented with each signature message sent in response to an on demand message. The counter will roll over after 256 messages. Upon connection, the value of the counter may not initially be zero.
certificate_id: [u8; 4]
The last 4 bytes of the certificate’s SHA-1 fingerprint
signature: ECDSASignature
Signature over the frames of this message group.
signed_messages: Vec<u8>
CRCs of the messages covered by this signature. For Skylark, which
delivers SBP messages wrapped in Swift’s proprietary RTCM message, these
are the 24-bit CRCs from the RTCM message framing. For SBP only streams,
this will be 16-bit CRCs from the SBP framing. See the flags
field to
determine the type of CRCs covered.
Implementations§
source§impl MsgEcdsaSignature
impl MsgEcdsaSignature
sourcepub fn crc_type(&self) -> Result<CrcType, u8>
pub fn crc_type(&self) -> Result<CrcType, u8>
Gets the CrcType stored in the flags
bitfield.
Returns Ok
if the bitrange contains a known CrcType
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of CrcType
were added.
sourcepub fn set_crc_type(&mut self, crc_type: CrcType)
pub fn set_crc_type(&mut self, crc_type: CrcType)
Set the bitrange corresponding to the CrcType of the flags
bitfield.
Trait Implementations§
source§impl Clone for MsgEcdsaSignature
impl Clone for MsgEcdsaSignature
source§fn clone(&self) -> MsgEcdsaSignature
fn clone(&self) -> MsgEcdsaSignature
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConcreteMessage for MsgEcdsaSignature
impl ConcreteMessage for MsgEcdsaSignature
source§const MESSAGE_TYPE: u16 = 3_080u16
const MESSAGE_TYPE: u16 = 3_080u16
source§const MESSAGE_NAME: &'static str = "MSG_ECDSA_SIGNATURE"
const MESSAGE_NAME: &'static str = "MSG_ECDSA_SIGNATURE"
source§impl Debug for MsgEcdsaSignature
impl Debug for MsgEcdsaSignature
source§impl<'de> Deserialize<'de> for MsgEcdsaSignature
impl<'de> Deserialize<'de> for MsgEcdsaSignature
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl FriendlyName for MsgEcdsaSignature
impl FriendlyName for MsgEcdsaSignature
fn friendly_name() -> &'static str
source§impl From<MsgEcdsaSignature> for Sbp
impl From<MsgEcdsaSignature> for Sbp
source§fn from(msg: MsgEcdsaSignature) -> Self
fn from(msg: MsgEcdsaSignature) -> Self
source§impl PartialEq for MsgEcdsaSignature
impl PartialEq for MsgEcdsaSignature
source§fn eq(&self, other: &MsgEcdsaSignature) -> bool
fn eq(&self, other: &MsgEcdsaSignature) -> bool
self
and other
values to be equal, and is used
by ==
.