pub struct NetworkKeys {
pub s0: [u8; 16],
pub s2_unauthenticated: [u8; 16],
pub s2_authenticated: [u8; 16],
pub s2_access_control: [u8; 16],
pub ecdh_private: [u8; 32],
pub lr_s2_authenticated: Option<[u8; 16]>,
pub lr_s2_access_control: Option<[u8; 16]>,
}Expand description
The network keys and the controller’s long-term S2 key pair.
Generate them once per network with NetworkKeys::generate and keep
them secret: anyone with these keys can read and command the network.
Fields§
§s0: [u8; 16]The S0 network key.
s2_unauthenticated: [u8; 16]S2 Unauthenticated.
s2_authenticated: [u8; 16]S2 Authenticated.
s2_access_control: [u8; 16]S2 Access Control.
ecdh_private: [u8; 32]The controller’s Curve25519 private key for S2 key exchange.
lr_s2_authenticated: Option<[u8; 16]>Long Range S2 Authenticated (Long Range nodes use their own keys).
lr_s2_access_control: Option<[u8; 16]>Long Range S2 Access Control.
Implementations§
Source§impl NetworkKeys
impl NetworkKeys
Sourcepub fn fill_long_range(&mut self) -> Result<bool, Error>
pub fn fill_long_range(&mut self) -> Result<bool, Error>
Adds the Long Range keys to keys made before they existed; true if any was added.
Sourcepub fn long_range_key(&self, class: SecurityClass) -> Option<&[u8; 16]>
pub fn long_range_key(&self, class: SecurityClass) -> Option<&[u8; 16]>
The Long Range key for a class (only the two authenticated S2 classes exist on Long Range).
Sourcepub fn key(&self, class: SecurityClass) -> &[u8; 16]
pub fn key(&self, class: SecurityClass) -> &[u8; 16]
The key for a class.
Sourcepub fn controller_dsk(&self) -> Dsk
pub fn controller_dsk(&self) -> Dsk
The controller’s DSK (first 16 bytes of its public key), for a controller-side QR label.
Trait Implementations§
Source§impl Clone for NetworkKeys
impl Clone for NetworkKeys
Source§impl Debug for NetworkKeys
impl Debug for NetworkKeys
Source§impl<'de> Deserialize<'de> for NetworkKeys
impl<'de> Deserialize<'de> for NetworkKeys
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
impl Eq for NetworkKeys
Source§impl PartialEq for NetworkKeys
impl PartialEq for NetworkKeys
Source§impl Serialize for NetworkKeys
impl Serialize for NetworkKeys
impl StructuralPartialEq for NetworkKeys
Auto Trait Implementations§
impl Freeze for NetworkKeys
impl RefUnwindSafe for NetworkKeys
impl Send for NetworkKeys
impl Sync for NetworkKeys
impl Unpin for NetworkKeys
impl UnsafeUnpin for NetworkKeys
impl UnwindSafe for NetworkKeys
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.