@sd-jwt/utils 0.4.0 → 0.4.1-next.2
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.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/disclosure.ts +6 -2
- package/src/test/disclosure.spec.ts +1 -1
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sd-jwt/utils",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1-next.2+b11bedf",
|
|
4
4
|
"description": "sd-jwt draft 7 implementation in typescript",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@sd-jwt/crypto-nodejs": "0.4.
|
|
41
|
+
"@sd-jwt/crypto-nodejs": "0.4.1-next.2+b11bedf"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@sd-jwt/types": "0.4.
|
|
44
|
+
"@sd-jwt/types": "0.4.1-next.2+b11bedf",
|
|
45
45
|
"js-base64": "^3.7.6"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"esm"
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "b11bedfe62dd1827653a76226ebdca3e0da1bbe0"
|
|
64
64
|
}
|
package/src/disclosure.ts
CHANGED
|
@@ -4,13 +4,17 @@ import {
|
|
|
4
4
|
Base64urlEncode,
|
|
5
5
|
} from './base64url';
|
|
6
6
|
import { SDJWTException } from './error';
|
|
7
|
-
import {
|
|
7
|
+
import type {
|
|
8
|
+
HasherAndAlg,
|
|
9
|
+
DisclosureData,
|
|
10
|
+
HasherAndAlgSync,
|
|
11
|
+
} from '@sd-jwt/types';
|
|
8
12
|
|
|
9
13
|
export class Disclosure<T = unknown> {
|
|
10
14
|
public salt: string;
|
|
11
15
|
public key?: string;
|
|
12
16
|
public value: T;
|
|
13
|
-
|
|
17
|
+
public _digest: string | undefined;
|
|
14
18
|
private _encoded: string | undefined;
|
|
15
19
|
|
|
16
20
|
public constructor(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { generateSalt, digest as hasher } from '@sd-jwt/crypto-nodejs';
|
|
2
2
|
import { Disclosure } from '../disclosure';
|
|
3
3
|
import { describe, expect, test } from 'vitest';
|
|
4
|
-
import { Base64urlEncode, SDJWTException } from '../index';
|
|
4
|
+
import { Base64urlEncode, type SDJWTException } from '../index';
|
|
5
5
|
|
|
6
6
|
const hash = { alg: 'SHA256', hasher };
|
|
7
7
|
|