pub struct IPv6NodeID {
pub node_id: Vec<u8>,
pub ipv6_addr: Ipv6Addr,
pub public_key: Vec<u8>,
pub signature: Vec<u8>,
pub timestamp_secs: u64,
pub salt: Vec<u8>,
}Expand description
IPv6-based node identity that binds node ID to actual network location
Fields§
§node_id: Vec<u8>Derived node ID (SHA256 of ipv6_addr + public_key + salt)
ipv6_addr: Ipv6AddrIPv6 address this node ID is bound to
public_key: Vec<u8>ML-DSA public key for signatures
signature: Vec<u8>Signature proving ownership of the IPv6 address and keys
timestamp_secs: u64Timestamp when this ID was generated (seconds since epoch)
salt: Vec<u8>Salt used in node ID generation (for freshness)
Implementations§
Source§impl IPv6NodeID
impl IPv6NodeID
Sourcepub fn generate(
ipv6_addr: Ipv6Addr,
secret: &MlDsaSecretKey,
public: &MlDsaPublicKey,
) -> Result<Self>
pub fn generate( ipv6_addr: Ipv6Addr, secret: &MlDsaSecretKey, public: &MlDsaPublicKey, ) -> Result<Self>
Generate a new IPv6-based node ID
Delegates to GenericIpNodeID for the core generation logic.
Sourcepub fn extract_subnet_64(&self) -> Ipv6Addr
pub fn extract_subnet_64(&self) -> Ipv6Addr
Extract /64 subnet from IPv6 address
Sourcepub fn extract_subnet_48(&self) -> Ipv6Addr
pub fn extract_subnet_48(&self) -> Ipv6Addr
Extract /48 subnet from IPv6 address
Sourcepub fn extract_subnet_32(&self) -> Ipv6Addr
pub fn extract_subnet_32(&self) -> Ipv6Addr
Extract /32 subnet from IPv6 address
Trait Implementations§
Source§impl Clone for IPv6NodeID
impl Clone for IPv6NodeID
Source§fn clone(&self) -> IPv6NodeID
fn clone(&self) -> IPv6NodeID
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IPv6NodeID
impl Debug for IPv6NodeID
Source§impl<'de> Deserialize<'de> for IPv6NodeID
impl<'de> Deserialize<'de> for IPv6NodeID
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 IPv6NodeID
impl RefUnwindSafe for IPv6NodeID
impl Send for IPv6NodeID
impl Sync for IPv6NodeID
impl Unpin for IPv6NodeID
impl UnsafeUnpin for IPv6NodeID
impl UnwindSafe for IPv6NodeID
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.