This repository contains the Java SDK for managing DID Documents & Verifiable Credentials registry using the Hedera Consensus Service.
Identity networks are set of artifacts on Hedera Consensus Service that allow applications to share common channels to publish and resolve DID documents, issue verifiable credentials and control their validity status. These artifacts include:
This SDK is designed to simplify :
The SDK does not impose any particular way of how the DID or verifiable credential documents are constructed. Each appnet creators can choose their best way of creating those documents and as long as these are valid JSON-LD files adhering to W3C standards, they will be handled by the SDK.
<dependency>
<groupId>com.hedera.hashgraph</groupId>
<artifactId>did-sdk-java</artifactId>
<version>0.0.1</version>
</dependency>
implementation 'com.hedera.hashgraph:did-sdk-java:0.0.1'
The /examples/appnet-api-server
folder contains an example implementation of an appnet that utilizes DID and VC SDK and exposes a REST API interface according to the Hedera DID Method Specification.
The appnet runs on localhost port 5050 be default. It does not expose any user interface, instead there is a collection of POSTMAN requests available here that demonstrate a full end-to-end flow of DID documents generation, publishing, update and deletion, as well as verifiable credential generation, issuance and revocation.
Please refer to the README file of the appnet project for more details.
Install Docker for Mac, or Docker for Windows
cd did-sdk-java/examples cp .env.sample .env nano .env
update the following environment variables with your `testnet` account details
* OPERATOR_ID=0.0.xxxx
* OPERATOR_KEY=302...
you may also edit the following to use a different network (ensure your OPERATOR_ID and OPERATOR_KEY are valid)
* NETWORK=testnet (can be `testnet`, `previewnet` or `mainnet`)
* MIRROR_PROVIDER=hedera (can be `hedera` or `kabuto` (note `kabuto` not available on `previewnet`))
```cmd
docker build -t did-demo .
docker run -p 5050:5050 did-demo:latest
cd did-sdk-java/examples
cp .env.sample .env
nano .env
update the following environment variables with your testnet
account details
you may also edit the following to use a different network (ensure your OPERATOR_ID and OPERATOR_KEY are valid)
testnet
, previewnet
or mainnet
)hedera
or kabuto
(note kabuto
not available on previewnet
))return to the did-sdk-java
folder
cd ..
run the appnet example
./gradlew :appnet-api-server:run
We welcome participation from all developers! For instructions on how to contribute to this repo, please review the Contributing Guide.
Licensed under Apache License, Version 2.0.
from the command line (gradle version 6.7.1)
Note: a gradle.properties
file must exist and contain the following information
sonatypeUsername=
sonatypePassword=
signing.keyId=
signing.password=
signing.secretKeyRingFile=
gradle publishToSonatype closeAndReleaseSonatypeStagingRepository