Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentralized-identity/did-common-java
Shared DID Java library.
https://github.com/decentralized-identity/did-common-java
decentralized-identifiers wg-id
Last synced: 5 days ago
JSON representation
Shared DID Java library.
- Host: GitHub
- URL: https://github.com/decentralized-identity/did-common-java
- Owner: decentralized-identity
- License: apache-2.0
- Created: 2018-08-21T12:10:58.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-22T19:43:27.000Z (3 months ago)
- Last Synced: 2024-11-25T16:38:54.466Z (28 days ago)
- Topics: decentralized-identifiers, wg-id
- Language: Java
- Size: 289 KB
- Stars: 47
- Watchers: 18
- Forks: 24
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# did-common-java
## Information
This is an implementation of the DID Core specification:
- [Decentralized Identifiers v1.0](https://w3c.github.io/did-core/)
## Maven
Build:
mvn clean install
Dependency:
danubetech-maven-public
https://repo.danubetech.com/repository/maven-public/
decentralized-identity
did-common-java
1.11.0
## 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