pub struct NoiseIdentity { /* private fields */ }Expand description
A Noise static keypair. The private half never leaves the process
unless the operator provisions it via to_hex/from_hex.
Implementations§
Source§impl NoiseIdentity
impl NoiseIdentity
Sourcepub fn to_hex(&self) -> String
pub fn to_hex(&self) -> String
Hex encoding of the private key, for provisioning a stable identity through configuration.
Sourcepub fn from_hex(hex_private: &str) -> Result<Self, String>
pub fn from_hex(hex_private: &str) -> Result<Self, String>
Reconstruct an identity from a hex private key. The public half is derived with X25519 (snow consumes the private key directly; it does not derive the public for us).
Sourcepub fn fingerprint(&self) -> [u8; 32]
pub fn fingerprint(&self) -> [u8; 32]
SHA-256 fingerprint of the static public key — the value a peer
pins via the pinned= URL parameter.
Trait Implementations§
Source§impl Clone for NoiseIdentity
impl Clone for NoiseIdentity
Source§fn clone(&self) -> NoiseIdentity
fn clone(&self) -> NoiseIdentity
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 NoiseIdentity
impl RefUnwindSafe for NoiseIdentity
impl Send for NoiseIdentity
impl Sync for NoiseIdentity
impl Unpin for NoiseIdentity
impl UnsafeUnpin for NoiseIdentity
impl UnwindSafe for NoiseIdentity
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