pub struct SigningConfig { /* private fields */ }mav2-message-signing only.Expand description
Configuration used for MAVLink 2 messages signing as defined in https://mavlink.io/en/guide/message_signing.html.
To use a SigningConfig for sending and reciving messages create a SigningData object using SigningData::from_config.
Debug output redacts the secret key.
§Key handling
This configuration implements neither Copy nor Clone. The owned secret
key is zeroized when this configuration is dropped.
This does not erase copies retained by the caller or guarantee erasure of
temporary copies created by moves. Zeroization requires destructors to run,
so it does not occur if they are skipped, for example on process abort or when
the configuration is intentionally leaked with std::mem::forget or Box::leak.
§Examples
Creating SigningData:
let config = SigningConfig::new([0u8; 32], 0, true, false);
let sign_data = SigningData::from_config(config);SigningConfig does not implement Clone:
fn requires_clone<T: Clone>() {}
requires_clone::<SigningConfig>();Implementations§
Source§impl SigningConfig
impl SigningConfig
Sourcepub fn new(
secret_key: [u8; 32],
link_id: u8,
sign_outgoing: bool,
allow_unsigned: bool,
) -> SigningConfig
pub fn new( secret_key: [u8; 32], link_id: u8, sign_outgoing: bool, allow_unsigned: bool, ) -> SigningConfig
Creates a new signing configuration.
If sign_outgoing is set messages send using this configuration will be signed.
If allow_unsigned is set, when receiving messages, all unsigned messages are accepted, this may also includes MAVLink 1 messages.
The key is stored in an owned buffer that is zeroized on drop. Since [u8; 32] is Copy, callers remain responsible for clearing
their own copies.