@sd-jwt/core 0.3.2-next.63 → 0.3.2-next.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +78 -0
  2. package/package.json +6 -6
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ ![License](https://img.shields.io/github/license/openwallet-foundation-labs/sd-jwt-js.svg)
2
+ ![NPM](https://img.shields.io/npm/v/%40sd-jwt%2Fcore)
3
+ ![Release](https://img.shields.io/github/v/release/openwallet-foundation-labs/sd-jwt-js)
4
+ ![Stars](https://img.shields.io/github/stars/openwallet-foundation-labs/sd-jwt-js)
5
+
6
+ # SD-JWT Implementation in JavaScript (TypeScript)
7
+
8
+ ## SD-JWT Core
9
+
10
+ ### About
11
+
12
+ Core library for selective disclosure JWTs
13
+
14
+ Check the detail description in our github [repo](https://github.com/openwallet-foundation-labs/sd-jwt-js).
15
+
16
+ ### Installation
17
+
18
+ To install this project, run the following command:
19
+
20
+ ```bash
21
+ # using npm
22
+ npm install @sd-jwt/core
23
+
24
+ # using yarn
25
+ yarn add @sd-jwt/core
26
+
27
+ # using pnpm
28
+ pnpm install @sd-jwt/core
29
+ ```
30
+
31
+ Ensure you have Node.js installed as a prerequisite.
32
+
33
+ ### Usage
34
+
35
+ Here's a basic example of how to use this library:
36
+
37
+ ```jsx
38
+ import { DisclosureFrame } from '@sd-jwt/core';
39
+
40
+ // Issuer defines the claims object with the user's information
41
+ const claims = {
42
+ firstname: 'John',
43
+ lastname: 'Doe',
44
+ ssn: '123-45-6789',
45
+ id: '1234',
46
+ };
47
+
48
+ // Issuer defines the disclosure frame to specify which claims can be disclosed/undisclosed
49
+ const disclosureFrame: DisclosureFrame<typeof claims> = {
50
+ _sd: ['firstname', 'lastname', 'ssn'],
51
+ };
52
+
53
+ // Issuer issues a signed JWT credential with the specified claims and disclosure frame
54
+ // returns an encoded JWT
55
+ const credential = await sdjwt.issue(claims, disclosureFrame);
56
+
57
+ // Holder may validate the credential from the issuer
58
+ const valid = await sdjwt.validate(credential);
59
+
60
+ // Holder defines the presentation frame to specify which claims should be presented
61
+ // The list of presented claims must be a subset of the disclosed claims
62
+ const presentationFrame = ['firstname', 'ssn'];
63
+
64
+ // Holder creates a presentation using the issued credential and the presentation frame
65
+ // returns an encoded SD JWT.
66
+ const presentation = await sdjwt.present(credential, presentationFrame);
67
+
68
+ // Verifier can verify the presentation using the Issuer's public key
69
+ const verified = await sdjwt.verify(presentation);
70
+ ```
71
+
72
+ Check out more details in our [documentation](https://github.com/openwallet-foundation-labs/sd-jwt-js/tree/next/docs) or [examples](https://github.com/openwallet-foundation-labs/sd-jwt-js/tree/next/examples)
73
+
74
+ ### Dependencies
75
+
76
+ - @sd-jwt/decode
77
+ - @sd-jwt/types
78
+ - @sd-jwt/utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sd-jwt/core",
3
- "version": "0.3.2-next.63+fb2e533",
3
+ "version": "0.3.2-next.64+0f4cd5d",
4
4
  "description": "sd-jwt draft 7 implementation in typescript",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -36,12 +36,12 @@
36
36
  },
37
37
  "license": "Apache-2.0",
38
38
  "devDependencies": {
39
- "@sd-jwt/crypto-nodejs": "0.3.2-next.63+fb2e533"
39
+ "@sd-jwt/crypto-nodejs": "0.3.2-next.64+0f4cd5d"
40
40
  },
41
41
  "dependencies": {
42
- "@sd-jwt/decode": "0.3.2-next.63+fb2e533",
43
- "@sd-jwt/types": "0.3.2-next.63+fb2e533",
44
- "@sd-jwt/utils": "0.3.2-next.63+fb2e533"
42
+ "@sd-jwt/decode": "0.3.2-next.64+0f4cd5d",
43
+ "@sd-jwt/types": "0.3.2-next.64+0f4cd5d",
44
+ "@sd-jwt/utils": "0.3.2-next.64+0f4cd5d"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -59,5 +59,5 @@
59
59
  "esm"
60
60
  ]
61
61
  },
62
- "gitHead": "fb2e5336529e8ef8fb4bb17b5aba77202dd8e784"
62
+ "gitHead": "0f4cd5d136936e2add0172bed5ab92ee3ce255fd"
63
63
  }