pub struct DidKey { /* private fields */ }Implementations§
Source§impl DidKey
impl DidKey
Sourcepub fn new_full(
enable_encryption_key_derivation: bool,
key_format: PublicKeyFormat,
) -> Self
pub fn new_full( enable_encryption_key_derivation: bool, key_format: PublicKeyFormat, ) -> Self
Creates a new DidKey resolver with optional encryption key derivation and a specific key format.
Sourcepub fn generate() -> Result<String, CryptoError>
pub fn generate() -> Result<String, CryptoError>
Generates did:key address ex nihilo, off self-generated Ed25519 key pair
Sourcepub fn from_ed25519_keypair(
keypair: &Ed25519KeyPair,
) -> Result<String, CryptoError>
pub fn from_ed25519_keypair( keypair: &Ed25519KeyPair, ) -> Result<String, CryptoError>
Computes did:key address corresponding to Ed25519 key pair
Sourcepub fn from_raw_public_key(
alg: Algorithm,
bytes: &[u8],
) -> Result<String, CryptoError>
pub fn from_raw_public_key( alg: Algorithm, bytes: &[u8], ) -> Result<String, CryptoError>
Computes did:key address corresponding to raw public key bytes
Sourcepub fn expand(&self, did: &str) -> Result<DIDDocument, DIDResolutionError>
pub fn expand(&self, did: &str) -> Result<DIDDocument, DIDResolutionError>
Expands did:key address into DID document
See Create a did key
Trait Implementations§
Source§impl DIDResolver for DidKey
impl DIDResolver for DidKey
Source§fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 str,
_options: &'life2 DIDResolutionOptions,
) -> Pin<Box<dyn Future<Output = ResolutionOutput> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 str,
_options: &'life2 DIDResolutionOptions,
) -> Pin<Box<dyn Future<Output = ResolutionOutput> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn dereference<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did_url: &'life1 str,
_options: &'life2 DereferencingOptions,
) -> Pin<Box<dyn Future<Output = DereferencingOutput> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn dereference<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did_url: &'life1 str,
_options: &'life2 DereferencingOptions,
) -> Pin<Box<dyn Future<Output = DereferencingOutput> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Dereferences a DID URL into its corresponding resource.
Auto Trait Implementations§
impl Freeze for DidKey
impl RefUnwindSafe for DidKey
impl Send for DidKey
impl Sync for DidKey
impl Unpin for DidKey
impl UnwindSafe for DidKey
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