pub struct SecretKey(/* private fields */);
Expand description
MAVLink 2
signature secret key.
A 32-byte secret key for MAVLink 2
message signing.
Can be constructed from various inputs. If input is too small, then remaining bytes will be set
to zeros. If input is larger than SIGNATURE_SECRET_KEY_LENGTH
, then all trailing bytes will
be dropped.
§Usage
Construct a secret key from byte array.
use mavio::protocol::SecretKey;
use mavio::consts::SIGNATURE_SECRET_KEY_LENGTH;
let key = SecretKey::from([0x1e; SIGNATURE_SECRET_KEY_LENGTH]);
Construct a secret key from a smaller byte slice, setting remaining bytes with zeros. For
slices larger than SIGNATURE_SECRET_KEY_LENGTH
, all trailing bytes will be ignored.
use mavio::protocol::SecretKey;
let key = SecretKey::from([0x1eu8; 10].as_slice());
Construct a secret key from &str
(String
and &String
are also supported).
use mavio::protocol::SecretKey;
let key = SecretKey::from("password");
§Links
Signature
is a container for storingMAVLink 2
signature.Sign
is a trait whichsha256_48
algorithms should implement.signature
field in MAVLink 2 message signing.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)