Implementation of identity.rs interfaces for various DID methods.
Note
We refer to the DID Core spec for the definition of the terms consumer and producer. "Consuming" means resolving and verifying, while "producing" means creating a DID document from given key material.
Method | Consumer | Producer |
---|---|---|
did:key | ☑️ | ☑️ |
did:web | ☑️ | ☑️ |
did:jwk | ☑️ | ☑️ |
did:iota | ☑️ | |
did:iota:smr | ☑️ | |
did:iota:rms | ☑️ |
Note
This workspace is structured in a way that keeps the individual DID method implementations as separate crates to allow easier replacement and extensibility.
use did_manager::Resolver;
use identity_iota::document::CoreDocument;
let resolver = Resolver::new().await;
let did = "did:key:z6Mkk7yqnGF3YwTrLpqrW6PGsKci7dNqh1CjnvMbzrMerSeL";
let document: CoreDocument = resolver.resolve(did).await.unwrap();
use did_manager::{DidMethod, SecretManager};
use identity_iota::document::CoreDocument;
let secret_manager = SecretManager::builder()
.snapshot_path("/path/to/file.stronghold")
.password("p4ssw0rd")
.build()
.await
.unwrap();
let document: CoreDocument = secret_manager.produce_document(DidMethod::Jwk).await.unwrap();
To generate a test coverage report locally, run the following command:
# Install tarpaulin
cargo install cargo-tarpaulin
# Create a test coverage report
cargo tarpaulin --workspace --out html --output-dir target/coverage