@sphereon/ssi-sdk-ext.jwt-service 0.28.1-feature.jose.vcdm.19 → 0.28.1-feature.jose.vcdm.20
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.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/functions/JWE.ts +3 -2
- package/src/functions/index.ts +15 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk-ext.jwt-service",
|
|
3
|
-
"version": "0.28.1-feature.jose.vcdm.
|
|
3
|
+
"version": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
4
4
|
"source": "./src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,25 +27,25 @@
|
|
|
27
27
|
"generate-plugin-schema": "sphereon dev generate-plugin-schema"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.28.1-feature.jose.vcdm.
|
|
31
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.28.1-feature.jose.vcdm.
|
|
32
|
-
"@sphereon/ssi-sdk-ext.key-manager": "0.28.1-feature.jose.vcdm.
|
|
33
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.28.1-feature.jose.vcdm.
|
|
34
|
-
"@sphereon/ssi-sdk-ext.x509-utils": "0.28.1-feature.jose.vcdm.
|
|
30
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
31
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
32
|
+
"@sphereon/ssi-sdk-ext.key-manager": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
33
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
34
|
+
"@sphereon/ssi-sdk-ext.x509-utils": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
35
35
|
"@sphereon/ssi-sdk.agent-config": "0.33.1-feature.jose.vcdm.56",
|
|
36
36
|
"@sphereon/ssi-types": "0.33.1-feature.jose.vcdm.56",
|
|
37
37
|
"@stablelib/random": "^1.0.2",
|
|
38
38
|
"@veramo/core": "4.2.0",
|
|
39
39
|
"@veramo/utils": "4.2.0",
|
|
40
40
|
"debug": "^4.3.4",
|
|
41
|
-
"jose": "^5.
|
|
41
|
+
"jose": "^5.10.0",
|
|
42
42
|
"jwt-decode": "^4.0.0",
|
|
43
43
|
"uint8arrays": " 3.1.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.28.1-feature.jose.vcdm.
|
|
47
|
-
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.28.1-feature.jose.vcdm.
|
|
48
|
-
"@sphereon/ssi-sdk-ext.kms-local": "0.28.1-feature.jose.vcdm.
|
|
46
|
+
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
47
|
+
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
48
|
+
"@sphereon/ssi-sdk-ext.kms-local": "0.28.1-feature.jose.vcdm.20+0d68761",
|
|
49
49
|
"@sphereon/ssi-sdk.dev": "0.33.1-feature.jose.vcdm.56",
|
|
50
50
|
"@veramo/data-store": "4.2.0",
|
|
51
51
|
"@veramo/did-manager": "4.2.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"X.509 Certificates",
|
|
82
82
|
"ARF"
|
|
83
83
|
],
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "0d68761c4490c4759a24780bdb9e29046145549d"
|
|
85
85
|
}
|
package/src/functions/JWE.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { defaultRandomSource, randomBytes, type RandomSource } from '@stablelib/
|
|
|
2
2
|
import { base64ToBytes, bytesToBase64url, decodeBase64url } from '@veramo/utils'
|
|
3
3
|
import * as jose from 'jose'
|
|
4
4
|
import type { JWEKeyManagementHeaderParameters, JWTDecryptOptions } from 'jose'
|
|
5
|
-
// @ts-ignore
|
|
6
|
-
import type { KeyLike } from 'jose/dist/types/types'
|
|
5
|
+
// // @ts-ignore
|
|
6
|
+
// import type { KeyLike } from 'jose/dist/types/types'
|
|
7
|
+
export type KeyLike = { type: string }
|
|
7
8
|
// @ts-ignore
|
|
8
9
|
import * as u8a from 'uint8arrays'
|
|
9
10
|
const { fromString, toString, concat } = u8a
|
package/src/functions/index.ts
CHANGED
|
@@ -1,31 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureManagedIdentifierResult,
|
|
3
|
-
ExternalIdentifierDidOpts,
|
|
4
|
-
ExternalIdentifierX5cOpts,
|
|
5
|
-
IIdentifierResolution,
|
|
3
|
+
type ExternalIdentifierDidOpts,
|
|
4
|
+
type ExternalIdentifierX5cOpts,
|
|
5
|
+
type IIdentifierResolution,
|
|
6
6
|
isManagedIdentifierDidResult,
|
|
7
7
|
isManagedIdentifierX5cResult,
|
|
8
|
-
ManagedIdentifierMethod,
|
|
9
|
-
ManagedIdentifierResult,
|
|
8
|
+
type ManagedIdentifierMethod,
|
|
9
|
+
type ManagedIdentifierResult,
|
|
10
10
|
resolveExternalJwkIdentifier,
|
|
11
11
|
} from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
12
12
|
import { verifyRawSignature } from '@sphereon/ssi-sdk-ext.key-utils'
|
|
13
|
-
import { JWK } from '@sphereon/ssi-types'
|
|
14
|
-
import { IAgentContext } from '@veramo/core'
|
|
13
|
+
import type { JWK } from '@sphereon/ssi-types'
|
|
14
|
+
import type { IAgentContext } from '@veramo/core'
|
|
15
15
|
import { base64ToBytes, bytesToBase64url, decodeJoseBlob, encodeJoseBlob } from '@veramo/utils'
|
|
16
16
|
// @ts-ignore
|
|
17
17
|
import * as u8a from 'uint8arrays'
|
|
18
18
|
const { fromString } = u8a
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import type {
|
|
21
21
|
CreateJwsCompactArgs,
|
|
22
22
|
CreateJwsFlattenedArgs,
|
|
23
23
|
CreateJwsJsonArgs,
|
|
24
24
|
IJwsValidationResult,
|
|
25
25
|
IRequiredContext,
|
|
26
|
-
isJwsCompact,
|
|
27
|
-
isJwsJsonFlattened,
|
|
28
|
-
isJwsJsonGeneral,
|
|
29
26
|
JweHeader,
|
|
30
27
|
Jws,
|
|
31
28
|
JwsCompact,
|
|
@@ -41,6 +38,13 @@ import {
|
|
|
41
38
|
VerifyJwsArgs,
|
|
42
39
|
} from '../types/IJwtService'
|
|
43
40
|
|
|
41
|
+
import {
|
|
42
|
+
isJwsCompact,
|
|
43
|
+
isJwsJsonFlattened,
|
|
44
|
+
isJwsJsonGeneral,
|
|
45
|
+
} from '../types/IJwtService'
|
|
46
|
+
|
|
47
|
+
|
|
44
48
|
const payloadToBytes = (payload: string | JwsPayload | Uint8Array): Uint8Array => {
|
|
45
49
|
const isBytes = payload instanceof Uint8Array
|
|
46
50
|
const isString = typeof payload === 'string'
|