pub struct SoftwareIdentity { /* private fields */ }Expand description
Cloning is deliberate: a holder that must both hand the identity to the MAC and retain signing ability (e.g. standalone node-identity bundles) keeps a clone rather than round-tripping secret bytes.
Implementations§
Source§impl SoftwareIdentity
impl SoftwareIdentity
pub fn generate(rng: &mut impl CryptoRngCore) -> Self
pub fn from_secret_bytes(bytes: &[u8; 32]) -> Self
Trait Implementations§
Source§impl Clone for SoftwareIdentity
impl Clone for SoftwareIdentity
Source§fn clone(&self) -> SoftwareIdentity
fn clone(&self) -> SoftwareIdentity
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl NodeIdentity for SoftwareIdentity
impl NodeIdentity for SoftwareIdentity
type Error = CryptoError
Source§fn public_key(&self) -> &PublicKey
fn public_key(&self) -> &PublicKey
Return the long-term Ed25519 public key for this identity.
Source§async fn sign(&self, message: &[u8]) -> Result<[u8; 64], Self::Error>
async fn sign(&self, message: &[u8]) -> Result<[u8; 64], Self::Error>
Sign an arbitrary message.
Source§async fn agree(&self, peer: &PublicKey) -> Result<SharedSecret, Self::Error>
async fn agree(&self, peer: &PublicKey) -> Result<SharedSecret, Self::Error>
Perform X25519-style key agreement with a peer public key.
Source§fn hint(&self) -> NodeHint
fn hint(&self) -> NodeHint
Return the three-byte node hint derived from
public_key.Auto Trait Implementations§
impl Freeze for SoftwareIdentity
impl RefUnwindSafe for SoftwareIdentity
impl Send for SoftwareIdentity
impl Sync for SoftwareIdentity
impl Unpin for SoftwareIdentity
impl UnwindSafe for SoftwareIdentity
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)