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

SD-CWT Prototype #2

Merged
merged 15 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ dist
.DS_Store
.env

sd-jwt
sd-jwt

example
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

🚧 Experimental implementation of sd-jwt for use with W3C Verifiable Credentials. 🔥

🚧 Extra experimental implementation of sd-cwt for SPICE 🔥

<img src="./transmute-banner.png" />

#### [Questions? Contact Transmute](https://transmute.typeform.com/to/RshfIw?typeform-source=vc-jwt-sd)
Expand Down Expand Up @@ -112,7 +114,7 @@ Example verification:

```json
{
"protectedHEader": {
"protectedHeader": {
"alg": "ES384"
},
"claimset": {
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testPathIgnorePatterns: ['examples', 'attic'],
testPathIgnorePatterns: ['example', 'attic'],
coverageReporters: ['json-summary'],
};
185 changes: 181 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@transmute/vc-jwt-sd",
"version": "0.0.1",
"version": "0.0.4",
"description": "Experimental",
"main": "./dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -42,9 +42,11 @@
"typescript": "^4.9.4"
},
"dependencies": {
"@transmute/cose": "^0.0.13",
"jose": "^4.13.1",
"json-pointer": "^0.6.2",
"moment": "^2.29.4",
"yaml": "^2.3.1"
"yaml": "^2.3.1",
"cbor-web": "9.0.0"
}
}
5 changes: 2 additions & 3 deletions src/Holder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import _select_disclosures from './_select_disclosures'

import Parse from "./Parse";

import digester from "./digester";

// SDJWTHolder
export default class Holder {
Expand All @@ -28,9 +27,9 @@ export default class Holder {
// todo: verify
const sd_jwt_payload = jose.decodeJwt(parsed.jwt);

const config = { digester }
const config = { digester: this.digester }

const {disclosureMap, hashToEncodedDisclosureMap} = Parse.expload(credential, config)
const {disclosureMap, hashToEncodedDisclosureMap} = await Parse.expload(credential, config)

const state = {
hs_disclosures: [],
Expand Down
Loading