Skip to content

Latest commit

 

History

History
69 lines (49 loc) · 3.22 KB

README.md

File metadata and controls

69 lines (49 loc) · 3.22 KB

DID Manager

semantic-release: angular OpenSSF Scorecard Coveralls


Implementation of identity.rs interfaces for various DID methods.

Supported 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 ☑️

Usage

Note

This workspace is structured in a way that keeps the individual DID method implementations as separate crates to allow easier replacement and extensibility.

Consuming DIDs

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();

Producing DIDs

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();

Development

Test coverage

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