This is a Java implementation of a Universal Resolver. See universal-resolver for a general introduction to Universal Resolvers and drivers.
For downloading the dependencies of this project a Personal Access Token for GitHub must be configured in file resolver/java/settings.xml, according to Creating a personal access token for the command line. Only the scope read:packages is required.
Maven build:
cd resolver/java
mvn --settings settings.xml clean install
You can use a Local Resolver in your Java project that invokes drivers locally (either directly via their JAVA API or via a Docker REST API).
Dependency:
<dependency>
<groupId>decentralized-identity</groupId>
<artifactId>uni-resolver-local</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
LocalUniResolver uniResolver = LocalUniResolver.getDefault();
uniResolver.getDriver(DidSovDriver.class).setLibIndyPath("./sovrin/lib/");
uniResolver.getDriver(DidSovDriver.class).setPoolConfigName("live");
uniResolver.getDriver(DidSovDriver.class).setPoolGenesisTxn("live.txn");
uniResolver.getDriver(DidBtcrDriver.class).setBitcoinConnection(BlockcypherAPIBitcoinConnection.get());
DIDDocument didDocument1 = uniResolver.resolve("did:sov:WRfXPg8dantKVubE3HX8pw").getDidDocument();
System.out.println(didDocument1.toJson());
DIDDocument didDocument2 = uniResolver.resolve("did:btcr:xkrn-xzcr-qqlv-j6sl").getDidDocument();
System.out.println(didDocument2.toJson());
DIDDocument didDocument3 = uniResolver.resolve("did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0").getDidDocument();
System.out.println(didDocument3.toJson());
You can deploy a Web Resolver that can be called by clients and invokes drivers locally (either directly via their JAVA API or via a Docker REST API).
See the Example Configuration.
How to run:
mvn jetty:run
You can use a Client Resolver in your Java project that calls a remote Web Resolver.
Dependency:
<dependency>
<groupId>decentralized-identity</groupId>
<artifactId>uni-resolver-client</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
ClientUniResolver uniResolver = new ClientUniResolver();
uniResolver.setResolveUri("https://uniresolver.danubetech.com/1.0/identifiers/");
DIDDocument didDocument1 = uniResolver.resolve("did:sov:WRfXPg8dantKVubE3HX8pw").getDidDocument();
System.out.println(didDocument1.toJson());
DIDDocument didDocument2 = uniResolver.resolve("did:btcr:xz35-jzv2-qqs2-9wjt").getDidDocument();
System.out.println(didDocument2.toJson());
DIDDocument didDocument3 = uniResolver.resolve("did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-0").getDidDocument();
System.out.println(didDocument3.toJson());
Decentralized Identity Foundation - http://identity.foundation/