pub struct DidPeer { /* private fields */ }Implementations§
Source§impl DidPeer
impl DidPeer
Sourcepub fn with_format(key_format: PublicKeyFormat) -> Self
pub fn with_format(key_format: PublicKeyFormat) -> Self
Creates new instance of DidPeer with given key format.
Sourcepub fn create_did_peer_0_from_ed25519_keypair(
keypair: &Ed25519KeyPair,
) -> Result<String, DIDPeerMethodError>
pub fn create_did_peer_0_from_ed25519_keypair( keypair: &Ed25519KeyPair, ) -> Result<String, DIDPeerMethodError>
Method 0: Generates did:peer address from ed25519 inception key without doc
See https://identity.foundation/peer-did-method-spec/#method-0-inception-key-without-doc
Sourcepub fn create_did_peer_0_from_raw_public_key(
alg: Algorithm,
bytes: &[u8],
) -> Result<String, DIDPeerMethodError>
pub fn create_did_peer_0_from_raw_public_key( alg: Algorithm, bytes: &[u8], ) -> Result<String, DIDPeerMethodError>
Method 0: Generates did:peer address from inception key without doc
See https://identity.foundation/peer-did-method-spec/#method-0-inception-key-without-doc
Sourcepub fn create_did_peer_1_from_stored_variant(
diddoc: &DIDDocument,
) -> Result<String, DIDPeerMethodError>
pub fn create_did_peer_1_from_stored_variant( diddoc: &DIDDocument, ) -> Result<String, DIDPeerMethodError>
Method 1: Generates did:peer address from DID document
See https://identity.foundation/peer-did-method-spec/#method-1-genesis-doc
Sourcepub fn create_did_peer_2(
keys: &[PurposedKey],
services: &[Service],
) -> Result<String, DIDPeerMethodError>
pub fn create_did_peer_2( keys: &[PurposedKey], services: &[Service], ) -> Result<String, DIDPeerMethodError>
Method 2: Generates did:peer address from multiple inception key
See https://identity.foundation/peer-did-method-spec/#method-2-multiple-inception-key-without-doc
Sourcepub fn create_did_peer_3(did: &str) -> Result<String, DIDPeerMethodError>
pub fn create_did_peer_3(did: &str) -> Result<String, DIDPeerMethodError>
Method 3: DID Shortening with SHA-256 Hash
See https://identity.foundation/peer-did-method-spec/#method-3-did-shortening-with-sha-256-hash
Sourcepub fn create_did_peer_4_from_stored_variant(
diddoc: &DIDDocument,
) -> Result<String, DIDPeerMethodError>
pub fn create_did_peer_4_from_stored_variant( diddoc: &DIDDocument, ) -> Result<String, DIDPeerMethodError>
Method 4: Generates did:peer address from DID document (embedding long form)
See https://identity.foundation/peer-did-method-spec/#method-4-short-form-and-long-form
Sourcepub fn shorten_did_peer_4(did: &str) -> Result<String, DIDPeerMethodError>
pub fn shorten_did_peer_4(did: &str) -> Result<String, DIDPeerMethodError>
Method 4: DID shortening for did:peer:4 addresses
See https://identity.foundation/peer-did-method-spec/#method-4-short-form-and-long-form
Sourcepub fn expand(&self, did: &str) -> Result<DIDDocument, DIDResolutionError>
pub fn expand(&self, did: &str) -> Result<DIDDocument, DIDResolutionError>
Expands did:peer address into DID document
Sourcepub fn expand_did_peer_0(
&self,
did: &str,
) -> Result<DIDDocument, DIDPeerMethodError>
pub fn expand_did_peer_0( &self, did: &str, ) -> Result<DIDDocument, DIDPeerMethodError>
Expands did:peer:0 address
See https://identity.foundation/peer-did-method-spec/#method-0-inception-key-without-doc
Sourcepub fn expand_did_peer_2(
&self,
did: &str,
) -> Result<DIDDocument, DIDPeerMethodError>
pub fn expand_did_peer_2( &self, did: &str, ) -> Result<DIDDocument, DIDPeerMethodError>
Expands did:peer:2 address
See https://identity.foundation/peer-did-method-spec/#resolving-a-didpeer2
Sourcepub fn expand_did_peer_4(
&self,
did: &str,
) -> Result<DIDDocument, DIDPeerMethodError>
pub fn expand_did_peer_4( &self, did: &str, ) -> Result<DIDDocument, DIDPeerMethodError>
Expands did:peer:4 address
See https://identity.foundation/peer-did-method-spec/#resolving-a-did
Trait Implementations§
Source§impl DIDResolver for DidPeer
impl DIDResolver for DidPeer
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,
Resolves a DID address into its corresponding DID document.