Struct sbp::messages::signing::msg_ecdsa_certificate::MsgEcdsaCertificate
source · pub struct MsgEcdsaCertificate {
pub sender_id: Option<u16>,
pub n_msg: u8,
pub certificate_id: [u8; 4],
pub flags: u8,
pub certificate_bytes: Vec<u8>,
}
Expand description
An ECDSA certificate split over multiple messages
A DER encoded x.509 ECDSA-256 certificate (using curve secp256r1).
Fields§
§sender_id: Option<u16>
The message sender_id
n_msg: u8
Total number messages that make up the certificate. The first nibble (mask 0xF0 or left shifted by 4 bits) is the size of the sequence (n), second nibble (mask 0x0F) is the zero-indexed counter (ith packet of n).
certificate_id: [u8; 4]
The last 4 bytes of the certificate’s SHA-1 fingerprint
flags: u8
§certificate_bytes: Vec<u8>
DER encoded x.509 ECDSA certificate bytes
Implementations§
source§impl MsgEcdsaCertificate
impl MsgEcdsaCertificate
sourcepub fn certificate_type(&self) -> Result<CertificateType, u8>
pub fn certificate_type(&self) -> Result<CertificateType, u8>
Gets the CertificateType stored in the flags
bitfield.
Returns Ok
if the bitrange contains a known CertificateType
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 CertificateType
were added.
sourcepub fn set_certificate_type(&mut self, certificate_type: CertificateType)
pub fn set_certificate_type(&mut self, certificate_type: CertificateType)
Set the bitrange corresponding to the CertificateType of the flags
bitfield.
Trait Implementations§
source§impl Clone for MsgEcdsaCertificate
impl Clone for MsgEcdsaCertificate
source§fn clone(&self) -> MsgEcdsaCertificate
fn clone(&self) -> MsgEcdsaCertificate
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl ConcreteMessage for MsgEcdsaCertificate
impl ConcreteMessage for MsgEcdsaCertificate
source§const MESSAGE_TYPE: u16 = 3_076u16
const MESSAGE_TYPE: u16 = 3_076u16
source§const MESSAGE_NAME: &'static str = "MSG_ECDSA_CERTIFICATE"
const MESSAGE_NAME: &'static str = "MSG_ECDSA_CERTIFICATE"
source§impl Debug for MsgEcdsaCertificate
impl Debug for MsgEcdsaCertificate
source§impl<'de> Deserialize<'de> for MsgEcdsaCertificate
impl<'de> Deserialize<'de> for MsgEcdsaCertificate
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 MsgEcdsaCertificate
impl FriendlyName for MsgEcdsaCertificate
fn friendly_name() -> &'static str
source§impl From<MsgEcdsaCertificate> for Sbp
impl From<MsgEcdsaCertificate> for Sbp
source§fn from(msg: MsgEcdsaCertificate) -> Self
fn from(msg: MsgEcdsaCertificate) -> Self
source§impl PartialEq for MsgEcdsaCertificate
impl PartialEq for MsgEcdsaCertificate
source§fn eq(&self, other: &MsgEcdsaCertificate) -> bool
fn eq(&self, other: &MsgEcdsaCertificate) -> bool
self
and other
values to be equal, and is used
by ==
.