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

Remove YAML; add disclosures to SD-JWT examples; add protected headers #272

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta http-equiv='Content-Type' content='text/html;charset=utf-8'/>
<title>Securing Verifiable Credentials using JOSE and COSE</title>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove"></script>
<script class="remove" src="https://cdn.jsdelivr.net/gh/w3c/vc-jose-cose/plugin/dist/main.js"></script>
<script class="remove" src="https://cdn.jsdelivr.net/gh/w3c/vc-jose-cose@219b0019a46c1f080dad388fde19bfd9ce218082/plugin/dist/main.js"></script>
<script class="remove">
// See https://github.com/w3c/respec/wiki/ for how to configure
// ReSpec
Expand Down
119 changes: 0 additions & 119 deletions plugin/attic/sd-jwt/index.js

This file was deleted.

4 changes: 2 additions & 2 deletions plugin/dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getCombinedHtml, getCoseHtml, getHtml, getJwtHtml, getSdJwtHtml} from './src/getHtml';
import { getCombinedHtml, getCoseHtml, getJwtHtml, getSdJwtHtml } from './src/getHtml';
import { getPrivateKey } from './src/exampleKey';
import { getCoseExample } from './src/exampleCose';
import { getJwtExample } from './src/exampleJwt';
Expand Down
13 changes: 6 additions & 7 deletions plugin/src/exampleJwt.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {holder, issuer, key, text} from "@transmute/verifiable-credentials";
import { base64url, holder, issuer, key, text } from "@transmute/verifiable-credentials";

import * as jose from 'jose'

Expand Down Expand Up @@ -73,13 +73,12 @@ export const getJwtExample = async (privateKey, messageJson) => {
const messageType = type.includes('VerifiableCredential') ? 'application/vc+ld+json+jwt' : 'application/vp+ld+json+jwt'
const message = await getBinaryMessage(privateKey, messageType, messageJson)
const messageEncoded = new TextDecoder().decode(message)
// const decodedHeader = jose.decodeProtectedHeader(messageEncoded)
// Not displaying protected header to save space
// <h1>Protected</h1>
// <pre>
// ${JSON.stringify(decodedHeader, null, 2)}
// </pre>
const decodedHeader = jose.decodeProtectedHeader(messageEncoded)
return `
<h1>Protected Headers</h1>
<pre>
${JSON.stringify(decodedHeader, null, 2)}
</pre>
<h1>${messageType.replace('+jwt', '')}</h1>
<pre>
${JSON.stringify(messageJson, null, 2)}
Expand Down
Loading
Loading