pub struct SessionKeys11 {
pub app_s_key: AppSKey,
pub f_nwk_s_int_key: FNwkSIntKey,
pub s_nwk_s_int_key: SNwkSIntKey,
pub nwk_s_enc_key: NwkSEncKey,
}Expand description
LoRaWAN 1.1 session keys derived during OTAA.
1.1 splits the 1.0 NwkSKey into three role-specific keys
(FNwkSIntKey, SNwkSIntKey, NwkSEncKey) plus keeps the application
session key. See crate::V1_1MicKeys for how they slot into MIC
computation.
Fields§
§app_s_key: AppSKeyApplication session key (FRMPayload crypt with FPort > 0).
f_nwk_s_int_key: FNwkSIntKeyForwarding network session integrity key (lower 2 MIC bytes for uplink Data frames).
s_nwk_s_int_key: SNwkSIntKeyServing network session integrity key (upper 2 MIC bytes for uplinks, full MIC for downlinks).
nwk_s_enc_key: NwkSEncKeyNetwork session encryption key (FOpts MAC commands, plus
FRMPayload when FPort == 0).
Implementations§
Source§impl SessionKeys11
impl SessionKeys11
Sourcepub fn derive(
app_key: &AppKey,
nwk_key: &NwkKey,
join_eui: &AppEui,
app_nonce: &AppNonce,
dev_nonce: &DevNonce,
) -> Self
pub fn derive( app_key: &AppKey, nwk_key: &NwkKey, join_eui: &AppEui, app_nonce: &AppNonce, dev_nonce: &DevNonce, ) -> Self
Derive all four 1.1 session keys.
AppSKey is derived from AppKey; the three network keys are
derived from NwkKey. Inputs include JoinEUI because 1.1 binds the
session to the join server identity.
§Examples
use lora_packet::{SessionKeys11, AppKey, NwkKey, AppEui, AppNonce, DevNonce};
let keys = SessionKeys11::derive(
&AppKey::new([0u8; 16]),
&NwkKey::new([0u8; 16]),
&AppEui::new([0u8; 8]),
&AppNonce::new([0, 0, 0]),
&DevNonce::new([0, 0]),
);
assert_ne!(keys.app_s_key.as_bytes(), keys.f_nwk_s_int_key.as_bytes());Trait Implementations§
Source§impl Clone for SessionKeys11
impl Clone for SessionKeys11
Source§fn clone(&self) -> SessionKeys11
fn clone(&self) -> SessionKeys11
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more