pub struct JoinServerKeys {
pub js_int_key: JSIntKey,
pub js_enc_key: JSEncKey,
}Expand description
Join Server keys (LoRaWAN 1.1) derived from NwkKey and DevEUI.
Used by the Join Server (not the device) for Rejoin-aware Join Accept
signing and re-encryption. Pair of keys; see JoinServerKeys::derive.
Fields§
§js_int_key: JSIntKeyIntegrity key for Join Accept and Rejoin Type 1 MIC.
js_enc_key: JSEncKeyEncryption key for re-encrypting Join Accept bodies sent to rejoining devices.
Implementations§
Source§impl JoinServerKeys
impl JoinServerKeys
Sourcepub fn derive(nwk_key: &NwkKey, dev_eui: &DevEui) -> Self
pub fn derive(nwk_key: &NwkKey, dev_eui: &DevEui) -> Self
Derive both JS keys from NwkKey and DevEUI.
§Examples
use lora_packet::{JoinServerKeys, NwkKey, DevEui};
let nwk_key = NwkKey::new([0x42u8; 16]);
let dev_eui = DevEui::new([0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88]);
let js = JoinServerKeys::derive(&nwk_key, &dev_eui);
assert_ne!(js.js_int_key.as_bytes(), js.js_enc_key.as_bytes());Trait Implementations§
Source§impl Clone for JoinServerKeys
impl Clone for JoinServerKeys
Source§fn clone(&self) -> JoinServerKeys
fn clone(&self) -> JoinServerKeys
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JoinServerKeys
impl RefUnwindSafe for JoinServerKeys
impl Send for JoinServerKeys
impl Sync for JoinServerKeys
impl Unpin for JoinServerKeys
impl UnsafeUnpin for JoinServerKeys
impl UnwindSafe for JoinServerKeys
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