Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: vc-jwt context #54

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.vscode
20 changes: 20 additions & 0 deletions examples/vc-2.0/vc-jwt.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
{
"vc": "http://www.w3.org/2018/credentials#",
"jwt": "http://example.com/jwt#"
}
],
"@type": "JwtVerifiableCredential",
"vc:credentialSubject": {
"@type": "JwtCredentialSubject",
"jwt:iss": {"@id": "vc:issuer"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this stuff needs to be in the @context, but I think the intention is clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made some adjustments - still working through a double check on n-quads bc json-ld is hard

"jwt:sub": {"@id": "vc:credentialSubject.id"},
"jwt:aud": {"@id": "vc:credentialSubject.audience"},
"jwt:exp": {"@id": "vc:expirationDate", "@type": "xsd:dateTime"},
"jwt:nbf": {"@id": "vc:notBefore", "@type": "xsd:dateTime"},
"jwt:iat": {"@id": "vc:issued", "@type": "xsd:dateTime"},
"jwt:jti": {"@id": "vc:id"}
}
}
12 changes: 12 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,18 @@ <h2>Version 2</h2>
<section>
<h2>Credential Metadata</h2>
<p><a data-cite="rfc7519#section-5.1">typ</a> MUST use the content type <code>verifiable-credential+jwt</code>.</p>
<p>
The content type <code>vc+jwt</code> implies the use of an `@context` that defines the registered claims present
in a JWT to provide semantic interoperabilite when using a `vc-jwt` in an RDF capacity.
mprorock marked this conversation as resolved.
Show resolved Hide resolved
This provides the ability to always transform or interpert a `vc-jwt` as a conforming verifiable credential
according to the [[vc-data-model]].
</p>
<aside
class="example"
title="JSON-LD context for vc-jwt"
>
<pre data-include="./examples/vc-2.0/vc-jwt.jsonld" data-include-format="json"></pre>
</aside>
<p class="issue" data-number="45"></p>
<p>If present, <a data-cite="rfc7519#section-5.2">cty</a> SHOULD use the content type <code>credential-claims-set+json</code>.</p>
<aside
Expand Down