Skip to content

Commit

Permalink
feat: Add DID 1.1 context
Browse files Browse the repository at this point in the history
  • Loading branch information
peacekeeper committed Jan 3, 2025
1 parent 1a30a0a commit 0167908
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/foundation/identity/did/jsonld/DIDContexts.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

public class DIDContexts {

public static final URI JSONLD_CONTEXT_W3_NS_DID_V1_1 = URI.create("https://www.w3.org/ns/did/v1.1");
public static final URI JSONLD_CONTEXT_W3_NS_DID_V1 = URI.create("https://www.w3.org/ns/did/v1");
public static final URI JSONLD_CONTEXT_W3_2019_DID_V1 = URI.create("https://www.w3.org/2019/did/v1");
public static final URI JSONLD_CONTEXT_W3ID_DID_V1 = URI.create("https://w3id.org/did/v1");
Expand All @@ -36,6 +37,8 @@ public class DIDContexts {

CONTEXTS = new HashMap<>();

CONTEXTS.put(JSONLD_CONTEXT_W3_NS_DID_V1_1,
JsonDocument.of(MediaType.JSON_LD, Objects.requireNonNull(DIDContexts.class.getResourceAsStream("diddocument-context-w3-ns-did-v1.1.jsonld"))));
CONTEXTS.put(JSONLD_CONTEXT_W3_NS_DID_V1,
JsonDocument.of(MediaType.JSON_LD, Objects.requireNonNull(DIDContexts.class.getResourceAsStream("diddocument-context-w3-ns-did-v1.jsonld"))));
CONTEXTS.put(JSONLD_CONTEXT_W3_2019_DID_V1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",

"alsoKnownAs": {
"@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
"@type": "@id"
},
"assertionMethod": {
"@id": "https://w3id.org/security#assertionMethod",
"@type": "@id",
"@container": "@set"
},
"authentication": {
"@id": "https://w3id.org/security#authenticationMethod",
"@type": "@id",
"@container": "@set"
},
"capabilityDelegation": {
"@id": "https://w3id.org/security#capabilityDelegationMethod",
"@type": "@id",
"@container": "@set"
},
"capabilityInvocation": {
"@id": "https://w3id.org/security#capabilityInvocationMethod",
"@type": "@id",
"@container": "@set"
},
"controller": {
"@id": "https://w3id.org/security#controller",
"@type": "@id"
},
"keyAgreement": {
"@id": "https://w3id.org/security#keyAgreementMethod",
"@type": "@id",
"@container": "@set"
},
"service": {
"@id": "https://www.w3.org/ns/did#service",
"@type": "@id",
"@context": {
"@protected": true,
"id": "@id",
"type": "@type",
"serviceEndpoint": {
"@id": "https://www.w3.org/ns/did#serviceEndpoint",
"@type": "@id"
}
}
},
"verificationMethod": {
"@id": "https://w3id.org/security#verificationMethod",
"@type": "@id"
}
}
}

0 comments on commit 0167908

Please sign in to comment.