Crates.io | caelum-diddoc |
lib.rs | caelum-diddoc |
version | 0.1.3 |
source | src |
created_at | 2019-12-09 12:02:33.266029 |
updated_at | 2019-12-18 15:38:43.162486 |
description | Self-Sovereign Identity rust/wasm crate |
homepage | |
repository | |
max_upload_size | |
id | 187933 |
size | 98,086 |
The diddoc
crate is aimed to help javascript
and rust
developers manage DID docs
(Decentralized Identity Documents) in an easy manner.
Following w3's specifications on DID
Documents this crate aims to be a Resolver.
This means it will create, read, update and delete all properties of a DID document. As well as
interacting with other DIDs and DID document, using proof verification.
Also, it will be able to interact with others on other Decentralized Identifier Registry.
This will can effectively be used to perform all the operations required of a CKMS
(cryptographic key management system), such as key registration, replacement, rotation,
recovery, and expiration.
More details in w3's method specifications.
You can read our code documentation, which makes reference to usage with javascript and rust as well as the actual implementation of the library.
For more details you can take a look at our book.
Clone repository and go to the book
directory:
git clone https://gitlab.com/caelum-tech/caelum-diddoc.git
cd caelum-diddoc/book
Download mdbook
and build the documentation:
cargo install mdbook
mdbook build
Open the book /your/relative/path/caelum-diddoc/book/book/index.html
on your favorite browser.
DidDoc
for JavaScript
npm
Add it to your package.json:
"devDependencies": {
"@caelum-tech/caelum-diddoc-nodejs": "^0.1.2",
...
}
Imported in your code:
const diddoc = require('@caelum-tech/caelum-diddoc-nodejs')
Finally you can use it as any other package:
const d = new diddoc.DidDoc('https://www.w3.org/ns/did/v1', 'did:lor:cat:lab:root')
console.log(d.toJSON())
Clone or download diddoc
repository
git clone ...
Go to diddoc
directory and build the package using wasm-pack
(make sure wasm-pack is installed)
cd diddoc
wasm-pack build
This will generate a directory called pkg
inside diddoc
directory.
Add the generated package to your package.json
;
"devDependencies": {
"diddoc": "file:../diddoc/pkg",
...
}
Now your ready to import it in your JavaScript
code as usual:
const diddoc = require('diddoc')
Finally you can use it as any other package:
const d = new diddoc.DidDoc('https://www.w3.org/ns/did/v1', 'did:lor:cat:lab:root')
console.log(d.toJSON())
Installed as a normal npm package:
npm i @caelum-tech/caelum-diddoc-nodejs
DidDoc
for Rust
Add crate to your Cargo.toml
...
[dependencies]
caelum-diddoc = "0.1.2"
...
Use and instantiate:
use caelum_diddoc::DidDocument;
let dd = DidDocument::default();
println!("{:#?}", dd);
A DID resolver is a software component with an API designed to accept requests for DID lookups and execute the corresponding DID method to retrieve the authoritative DID Document. To be conformant with this specification, a DID resolver:
SHOULD validate that a DID is valid according to its DID method specification, otherwise it should produce an error.
MUST conform to the requirements of the applicable DID method specification when performing DID resolution operations.
SHOULD offer the service of verifying the integrity of the DID Document if it is signed.
MAY offer the service of returning requested properties of the DID Document.
did-erc725
, did-btcr
, did-sov
, and others.Please, contribute to diddoc
! The more the better! Feel free to to open an issue and/or contacting directly with the
owner for any request or suggestion.
This library is created to satisfy w3's specifications.
This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at http://contributor-covenant.org/version/1/4
This project is distributed under the terms of both the Apache License (Version 2.0) and the MIT license, specified in LICENSE-APACHE and LICENSE-MIT respectively.