pub struct Identity {
pub pubkey: [u8; 32],
pub node_id: NodeId,
}Expand description
Identity pairs an Ed25519 public key with its derived NodeId,
representing a fully authenticated peer identity.
The pubkey field holds the raw 32-byte Ed25519 public key bytes. The
node_id field holds the node ID derived from that key. Together they allow
the caller to verify both the cryptographic material and the stable
network-layer identifier of a remote peer.
Identity values are returned by the server’s on_connect callback and by
client-side peer inspection APIs.
§Example
use nwep::types::Identity;
let id = Identity::default();
assert!(id.node_id.is_zero());Fields§
§pubkey: [u8; 32]pubkey is the raw 32-byte Ed25519 public key of the peer.
node_id: NodeIdnode_id is the 32-byte node ID derived from Identity::pubkey.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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