pub struct Ed25519DidKey { /* private fields */ }Expand description
Real key material for a local DID subject.
Holds an Ed25519 signing key (advertised as the DID document’s authentication key) and an independent X25519 static secret (advertised as the key-agreement key).
Implementations§
Source§impl Ed25519DidKey
impl Ed25519DidKey
Sourcepub fn from_seed(seed: impl AsRef<[u8]>) -> Self
pub fn from_seed(seed: impl AsRef<[u8]>) -> Self
Derive a key pair deterministically from a seed via SHA-256 expansion.
Only as strong as the seed’s entropy — use generate
unless you need reproducible keys (tests, fixtures).
Sourcepub fn signing_public(&self) -> [u8; 32]
pub fn signing_public(&self) -> [u8; 32]
Ed25519 public key bytes (the DID document authentication key).
Sourcepub fn agreement_public(&self) -> [u8; 32]
pub fn agreement_public(&self) -> [u8; 32]
X25519 public key bytes (the DID document key-agreement key).
Sourcepub fn document(&self, did: Did) -> DidDocument
pub fn document(&self, did: Did) -> DidDocument
Build a DID document advertising this key pair’s public halves.
Trait Implementations§
Source§impl Clone for Ed25519DidKey
impl Clone for Ed25519DidKey
Source§fn clone(&self) -> Ed25519DidKey
fn clone(&self) -> Ed25519DidKey
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 Ed25519DidKey
impl RefUnwindSafe for Ed25519DidKey
impl Send for Ed25519DidKey
impl Sync for Ed25519DidKey
impl Unpin for Ed25519DidKey
impl UnsafeUnpin for Ed25519DidKey
impl UnwindSafe for Ed25519DidKey
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