Giter Club home page Giter Club logo

did-common-java's Introduction

did-common-java

Information

This is an implementation of the DID Core specification:

Maven

Build:

mvn clean install

Dependency:

<repositories>
	<repository>
		<id>danubetech-maven-public</id>
		<url>https://repo.danubetech.com/repository/maven-public/</url>
	</repository>
</repositories>

<dependency>
	<groupId>decentralized-identity</groupId>
	<artifactId>did-common-java</artifactId>
	<version>1.0.0</version>
</dependency>

Example

Example code:

URI did = URI.create("did:ex:1234");

Service service = Service.builder()
        .type("ServiceEndpointProxyService")
        .serviceEndpoint("https://myservice.com/myendpoint")
        .build();

VerificationMethod verificationMethod = VerificationMethod.builder()
        .id(URI.create(did + "#key-1"))
        .type("Ed25519VerificationKey2018")
        .publicKeyBase58("FyfKP2HvTKqDZQzvyL38yXH7bExmwofxHf2NR5BrcGf1")
        .build();

DIDDocument diddoc = DIDDocument.builder()
        .id(did)
        .service(service)
        .verificationMethod(verificationMethod)
        .build();

System.out.println(diddoc.toJson(true));

Example DID document:

{
  "@context" : "https://www.w3.org/ns/did/v1",
  "id" : "did:ex:1234",
  "verificationMethod" : {
    "type" : "Ed25519VerificationKey2018",
    "id" : "did:ex:1234#key-1",
    "publicKeyBase58" : "FyfKP2HvTKqDZQzvyL38yXH7bExmwofxHf2NR5BrcGf1"
  },
  "service" : {
    "type" : "ServiceEndpointProxyService",
    "serviceEndpoint" : "https://myservice.com/myendpoint"
  }
}

About

Decentralized Identity Foundation - https://identity.foundation/


This software library is part of a project that has received funding from the European Union's Horizon 2020 research and innovation programme under grant agreement No 871932

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.