Skip to content

Set of DID resolvers in Java with minimal dependencies

License

Notifications You must be signed in to change notification settings

reinkrul/java-did-resolvers

Repository files navigation

java-did-resolvers

Build Status Maven Central

A set of DID resolvers in Java with minimal dependencies.

Supported DID methods

Maven dependency:

<dependency>
    <groupId>nl.reinkrul.did</groupId>
    <artifactId>did-web-resolver</artifactId>
    <version>0.1.0</version>
</dependency>

Maven dependency:

<dependency>
    <groupId>nl.reinkrul.did</groupId>
    <artifactId>did-jwk-resolver</artifactId>
    <version>0.1.0</version>
</dependency>

Usage

You can resolve the DID document, yields the parsed DID document:

// this populates didDocument, does not populate didDocumentBytes and contentType
var result = new WebResolver().Resolve(new URI("did:web:example.com"));
System.out.println(result.getDIDDocument().getId());

If you want the raw data as byte[] (as specified by the DID core specification), you resolve the presentation:

// this populates didDocumentBytes and contentType, does not populate didDocument
var result = new WebResolver().ResolvePresentation(new URI("did:web:example.com"));
var data = result.getDIDDocumentBytes();
// do something with the raw data

JSON-LD

The library supports JSON-LD documents: they will be unmarshalled, but no further JSON-LD processing will be performed.

Compliancy

This library's API follows W3C DID Core specification v1.0.

About

Set of DID resolvers in Java with minimal dependencies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published