pub struct NwkSKey(/* private fields */);Expand description
Network session key (LoRaWAN 1.0).
Used for:
- Data MIC computation (see
crate::LoraPacket::verify_mic_v1_0). FRMPayloadcrypt whenFPort = 0(MAC commands inFRMPayload).
In 1.1, the equivalent roles split into FNwkSIntKey, SNwkSIntKey,
and NwkSEncKey.
Implementations§
Source§impl NwkSKey
impl NwkSKey
Sourcepub const fn from_slice(s: &[u8]) -> Result<Self>
pub const fn from_slice(s: &[u8]) -> Result<Self>
Construct from a slice, validating the length.
§Errors
Returns Error::InvalidKeyLength when the slice is not 16 bytes.
Source§impl NwkSKey
impl NwkSKey
Sourcepub fn from_hex(s: &str) -> Result<Self>
pub fn from_hex(s: &str) -> Result<Self>
Construct from a hex string (32 hex chars for 16 bytes).
§Errors
Error::Hex if the input is not valid hex.
Error::InvalidKeyLength if the decoded byte length is not 16.
Sourcepub fn from_base64(s: &str) -> Result<Self>
pub fn from_base64(s: &str) -> Result<Self>
Construct from a standard base64 string.
§Errors
Error::Base64 if the input is not valid base64.
Error::InvalidKeyLength if the decoded byte length is not 16.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NwkSKey
Available on crate feature serde only.
impl<'de> Deserialize<'de> for NwkSKey
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NwkSKey
impl StructuralPartialEq for NwkSKey
Auto Trait Implementations§
impl Freeze for NwkSKey
impl RefUnwindSafe for NwkSKey
impl Send for NwkSKey
impl Sync for NwkSKey
impl Unpin for NwkSKey
impl UnsafeUnpin for NwkSKey
impl UnwindSafe for NwkSKey
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