@sphereon/ssi-sdk-ext.identifier-resolution 0.28.1-feature.esm.cjs.9 → 0.28.1-feature.oyd.cmsm.improv.16
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/agent/IdentifierResolution.d.ts +38 -0
- package/dist/agent/IdentifierResolution.d.ts.map +1 -0
- package/dist/agent/IdentifierResolution.js +123 -0
- package/dist/agent/IdentifierResolution.js.map +1 -0
- package/dist/functions/LegacySupport.d.ts +12 -0
- package/dist/functions/LegacySupport.d.ts.map +1 -0
- package/dist/functions/LegacySupport.js +39 -0
- package/dist/functions/LegacySupport.js.map +1 -0
- package/dist/functions/externalIdentifierFunctions.d.ts +26 -0
- package/dist/functions/externalIdentifierFunctions.d.ts.map +1 -0
- package/dist/functions/externalIdentifierFunctions.js +250 -0
- package/dist/functions/externalIdentifierFunctions.js.map +1 -0
- package/dist/functions/externalOIDFIdentifier.d.ts +19 -0
- package/dist/functions/externalOIDFIdentifier.d.ts.map +1 -0
- package/dist/functions/externalOIDFIdentifier.js +106 -0
- package/dist/functions/externalOIDFIdentifier.js.map +1 -0
- package/dist/functions/index.d.ts +5 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +21 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/functions/managedIdentifierFunctions.d.ts +38 -0
- package/dist/functions/managedIdentifierFunctions.d.ts.map +1 -0
- package/dist/functions/managedIdentifierFunctions.js +359 -0
- package/dist/functions/managedIdentifierFunctions.js.map +1 -0
- package/dist/index.d.ts +7 -434
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -5333
- package/dist/index.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types/IIdentifierResolution.d.ts +42 -0
- package/dist/types/IIdentifierResolution.d.ts.map +1 -0
- package/dist/types/IIdentifierResolution.js +21 -0
- package/dist/types/IIdentifierResolution.js.map +1 -0
- package/dist/types/common.d.ts +20 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +51 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/externalIdentifierTypes.d.ts +114 -0
- package/dist/types/externalIdentifierTypes.d.ts.map +1 -0
- package/dist/types/externalIdentifierTypes.js +44 -0
- package/dist/types/externalIdentifierTypes.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/managedIdentifierTypes.d.ts +122 -0
- package/dist/types/managedIdentifierTypes.d.ts.map +1 -0
- package/dist/types/managedIdentifierTypes.js +63 -0
- package/dist/types/managedIdentifierTypes.js.map +1 -0
- package/package.json +22 -34
- package/plugin.schema.json +712 -638
- package/src/agent/IdentifierResolution.ts +35 -39
- package/src/functions/externalIdentifierFunctions.ts +14 -21
- package/src/functions/externalOIDFIdentifier.ts +3 -6
- package/src/functions/managedIdentifierFunctions.ts +6 -7
- package/src/index.ts +1 -1
- package/src/types/IIdentifierResolution.ts +1 -1
- package/src/types/IJwtService.d.ts +2 -3
- package/src/types/externalIdentifierTypes.ts +1 -1
- package/dist/index.cjs +0 -5336
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -439
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { globalCrypto } from '@sphereon/ssi-sdk-ext.key-utils'
|
|
2
2
|
import { IAgentContext, IAgentPlugin, IDIDManager, IKeyManager } from '@veramo/core'
|
|
3
3
|
import { ExternalIdentifierOIDFEntityIdOpts, ExternalIdentifierOIDFEntityIdResult } from '../types'
|
|
4
|
-
import { schema } from '
|
|
4
|
+
import { schema } from '..'
|
|
5
5
|
import { resolveExternalIdentifier, ensureManagedIdentifierResult } from '../functions'
|
|
6
6
|
import {
|
|
7
7
|
ExternalIdentifierDidOpts,
|
|
@@ -34,27 +34,24 @@ import {
|
|
|
34
34
|
} from '../types'
|
|
35
35
|
import { IOIDFClient } from '@sphereon/ssi-sdk.oidf-client'
|
|
36
36
|
|
|
37
|
-
import { webcrypto } from 'node:crypto'
|
|
38
|
-
|
|
39
37
|
/**
|
|
40
38
|
* @public
|
|
41
39
|
*/
|
|
42
40
|
export class IdentifierResolution implements IAgentPlugin {
|
|
43
|
-
|
|
44
|
-
readonly _crypto: webcrypto.Crypto
|
|
41
|
+
private readonly _crypto: Crypto
|
|
45
42
|
|
|
46
43
|
readonly schema = schema.IMnemonicInfoGenerator
|
|
47
44
|
readonly methods: IIdentifierResolution = {
|
|
48
|
-
identifierManagedGet: this.
|
|
49
|
-
identifierManagedGetByDid: this.
|
|
50
|
-
identifierManagedGetByKid: this.
|
|
51
|
-
identifierManagedGetByJwk: this.
|
|
52
|
-
identifierManagedGetByX5c: this.
|
|
53
|
-
identifierManagedGetByKey: this.
|
|
54
|
-
identifierManagedGetByCoseKey: this.
|
|
55
|
-
identifierManagedGetByOID4VCIssuer: this.
|
|
56
|
-
|
|
57
|
-
identifierExternalResolve: this.
|
|
45
|
+
identifierManagedGet: this.identifierGetManaged.bind(this),
|
|
46
|
+
identifierManagedGetByDid: this.identifierGetManagedByDid.bind(this),
|
|
47
|
+
identifierManagedGetByKid: this.identifierGetManagedByKid.bind(this),
|
|
48
|
+
identifierManagedGetByJwk: this.identifierGetManagedByJwk.bind(this),
|
|
49
|
+
identifierManagedGetByX5c: this.identifierGetManagedByX5c.bind(this),
|
|
50
|
+
identifierManagedGetByKey: this.identifierGetManagedByKey.bind(this),
|
|
51
|
+
identifierManagedGetByCoseKey: this.identifierGetManagedByCoseKey.bind(this),
|
|
52
|
+
identifierManagedGetByOID4VCIssuer: this.identifierGetManagedByOID4VCIssuer.bind(this),
|
|
53
|
+
|
|
54
|
+
identifierExternalResolve: this.identifierResolveExternal.bind(this),
|
|
58
55
|
identifierExternalResolveByDid: this.identifierExternalResolveByDid.bind(this),
|
|
59
56
|
identifierExternalResolveByX5c: this.identifierExternalResolveByX5c.bind(this),
|
|
60
57
|
identifierExternalResolveByJwk: this.identifierExternalResolveByJwk.bind(this),
|
|
@@ -67,9 +64,7 @@ export class IdentifierResolution implements IAgentPlugin {
|
|
|
67
64
|
/**
|
|
68
65
|
* TODO: Add a cache, as we are retrieving the same keys/info quite often
|
|
69
66
|
*/
|
|
70
|
-
constructor(opts?: {
|
|
71
|
-
crypto?: webcrypto.Crypto
|
|
72
|
-
}) {
|
|
67
|
+
constructor(opts?: { crypto?: Crypto }) {
|
|
73
68
|
this._crypto = globalCrypto(false, opts?.crypto)
|
|
74
69
|
}
|
|
75
70
|
|
|
@@ -78,64 +73,65 @@ export class IdentifierResolution implements IAgentPlugin {
|
|
|
78
73
|
* integrate a plugin for anomaly detection. Having a single method helps
|
|
79
74
|
* @param args
|
|
80
75
|
* @param context
|
|
76
|
+
* @private
|
|
81
77
|
*/
|
|
82
|
-
private async
|
|
78
|
+
private async identifierGetManaged(
|
|
83
79
|
args: ManagedIdentifierOptsOrResult,
|
|
84
80
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
85
81
|
): Promise<ManagedIdentifierResult> {
|
|
86
82
|
return await ensureManagedIdentifierResult({ ...args, crypto: this._crypto }, context)
|
|
87
83
|
}
|
|
88
84
|
|
|
89
|
-
private async
|
|
85
|
+
private async identifierGetManagedByDid(
|
|
90
86
|
args: ManagedIdentifierDidOpts,
|
|
91
87
|
context: IAgentContext<IKeyManager & IDIDManager & IIdentifierResolution>
|
|
92
88
|
): Promise<ManagedIdentifierDidResult> {
|
|
93
|
-
return (await this.
|
|
89
|
+
return (await this.identifierGetManaged({ ...args, method: 'did' }, context)) as ManagedIdentifierDidResult
|
|
94
90
|
}
|
|
95
91
|
|
|
96
|
-
private async
|
|
92
|
+
private async identifierGetManagedByKid(
|
|
97
93
|
args: ManagedIdentifierKidOpts,
|
|
98
94
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
99
95
|
): Promise<ManagedIdentifierKidResult> {
|
|
100
|
-
return (await this.
|
|
96
|
+
return (await this.identifierGetManaged({ ...args, method: 'kid' }, context)) as ManagedIdentifierKidResult
|
|
101
97
|
}
|
|
102
98
|
|
|
103
|
-
private async
|
|
99
|
+
private async identifierGetManagedByKey(
|
|
104
100
|
args: ManagedIdentifierKeyOpts,
|
|
105
101
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
106
102
|
): Promise<ManagedIdentifierKeyResult> {
|
|
107
|
-
return (await this.
|
|
103
|
+
return (await this.identifierGetManaged({ ...args, method: 'key' }, context)) as ManagedIdentifierKeyResult
|
|
108
104
|
}
|
|
109
105
|
|
|
110
|
-
private async
|
|
106
|
+
private async identifierGetManagedByCoseKey(
|
|
111
107
|
args: ManagedIdentifierCoseKeyOpts,
|
|
112
108
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
113
109
|
): Promise<ManagedIdentifierCoseKeyResult> {
|
|
114
|
-
return (await this.
|
|
110
|
+
return (await this.identifierGetManaged({ ...args, method: 'cose_key' }, context)) as ManagedIdentifierCoseKeyResult
|
|
115
111
|
}
|
|
116
112
|
|
|
117
|
-
private async
|
|
113
|
+
private async identifierGetManagedByOID4VCIssuer(
|
|
118
114
|
args: ManagedIdentifierOID4VCIssuerOpts,
|
|
119
115
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
120
116
|
): Promise<ManagedIdentifierOID4VCIssuerResult> {
|
|
121
|
-
return (await this.
|
|
117
|
+
return (await this.identifierGetManaged({ ...args, method: 'oid4vci-issuer' }, context)) as ManagedIdentifierOID4VCIssuerResult
|
|
122
118
|
}
|
|
123
119
|
|
|
124
|
-
private async
|
|
120
|
+
private async identifierGetManagedByJwk(
|
|
125
121
|
args: ManagedIdentifierJwkOpts,
|
|
126
122
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
127
123
|
): Promise<ManagedIdentifierJwkResult> {
|
|
128
|
-
return (await this.
|
|
124
|
+
return (await this.identifierGetManaged({ ...args, method: 'jwk' }, context)) as ManagedIdentifierJwkResult
|
|
129
125
|
}
|
|
130
126
|
|
|
131
|
-
private async
|
|
127
|
+
private async identifierGetManagedByX5c(
|
|
132
128
|
args: ManagedIdentifierX5cOpts,
|
|
133
129
|
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
134
130
|
): Promise<ManagedIdentifierX5cResult> {
|
|
135
|
-
return (await this.
|
|
131
|
+
return (await this.identifierGetManaged({ ...args, method: 'x5c' }, context)) as ManagedIdentifierX5cResult
|
|
136
132
|
}
|
|
137
133
|
|
|
138
|
-
private async
|
|
134
|
+
private async identifierResolveExternal(
|
|
139
135
|
args: ExternalIdentifierOpts,
|
|
140
136
|
context: IAgentContext<IKeyManager | IOIDFClient>
|
|
141
137
|
): Promise<ExternalIdentifierResult> {
|
|
@@ -143,28 +139,28 @@ export class IdentifierResolution implements IAgentPlugin {
|
|
|
143
139
|
}
|
|
144
140
|
|
|
145
141
|
private async identifierExternalResolveByDid(args: ExternalIdentifierDidOpts, context: IAgentContext<any>): Promise<ExternalIdentifierDidResult> {
|
|
146
|
-
return (await this.
|
|
142
|
+
return (await this.identifierResolveExternal({ ...args, method: 'did' }, context)) as ExternalIdentifierDidResult
|
|
147
143
|
}
|
|
148
144
|
|
|
149
145
|
private async identifierExternalResolveByX5c(args: ExternalIdentifierX5cOpts, context: IAgentContext<any>): Promise<ExternalIdentifierX5cResult> {
|
|
150
|
-
return (await this.
|
|
146
|
+
return (await this.identifierResolveExternal({ ...args, method: 'x5c' }, context)) as ExternalIdentifierX5cResult
|
|
151
147
|
}
|
|
152
148
|
|
|
153
149
|
private async identifierExternalResolveByCoseKey(
|
|
154
150
|
args: ExternalIdentifierCoseKeyOpts,
|
|
155
151
|
context: IAgentContext<any>
|
|
156
152
|
): Promise<ExternalIdentifierCoseKeyResult> {
|
|
157
|
-
return (await this.
|
|
153
|
+
return (await this.identifierResolveExternal({ ...args, method: 'cose_key' }, context)) as ExternalIdentifierCoseKeyResult
|
|
158
154
|
}
|
|
159
155
|
|
|
160
156
|
private async identifierExternalResolveByJwk(args: ExternalIdentifierJwkOpts, context: IAgentContext<any>): Promise<ExternalIdentifierJwkResult> {
|
|
161
|
-
return (await this.
|
|
157
|
+
return (await this.identifierResolveExternal({ ...args, method: 'jwk' }, context)) as ExternalIdentifierJwkResult
|
|
162
158
|
}
|
|
163
159
|
|
|
164
160
|
private async identifierExternalResolveByOIDFEntityId(
|
|
165
161
|
args: ExternalIdentifierOIDFEntityIdOpts,
|
|
166
162
|
context: IAgentContext<any>
|
|
167
163
|
): Promise<ExternalIdentifierOIDFEntityIdResult> {
|
|
168
|
-
return (await this.
|
|
164
|
+
return (await this.identifierResolveExternal({ ...args, method: 'entity_id' }, context)) as ExternalIdentifierOIDFEntityIdResult
|
|
169
165
|
}
|
|
170
166
|
}
|
|
@@ -36,10 +36,9 @@ import {
|
|
|
36
36
|
} from '../types'
|
|
37
37
|
import { resolveExternalOIDFEntityIdIdentifier } from '.'
|
|
38
38
|
|
|
39
|
-
import { webcrypto } from 'node:crypto'
|
|
40
39
|
export async function resolveExternalIdentifier(
|
|
41
40
|
opts: ExternalIdentifierOpts & {
|
|
42
|
-
crypto?:
|
|
41
|
+
crypto?: Crypto
|
|
43
42
|
},
|
|
44
43
|
context: IAgentContext<any>
|
|
45
44
|
): Promise<ExternalIdentifierResult> {
|
|
@@ -66,7 +65,7 @@ export async function resolveExternalIdentifier(
|
|
|
66
65
|
|
|
67
66
|
export async function resolveExternalX5cIdentifier(
|
|
68
67
|
opts: ExternalIdentifierX5cOpts & {
|
|
69
|
-
crypto?:
|
|
68
|
+
crypto?: Crypto
|
|
70
69
|
},
|
|
71
70
|
context: IAgentContext<IResolver & IDIDManager>
|
|
72
71
|
): Promise<ExternalIdentifierX5cResult> {
|
|
@@ -246,24 +245,18 @@ export async function resolveExternalDidIdentifier(
|
|
|
246
245
|
const didDocument = didResolutionResult.didDocument ?? undefined
|
|
247
246
|
const didJwks = didDocument ? didDocumentToJwks(didDocument) : undefined
|
|
248
247
|
const jwks = didJwks
|
|
249
|
-
? Array.from(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
publicKeyHex: jwkTtoPublicKeyHex(jwk),
|
|
262
|
-
}
|
|
263
|
-
})
|
|
264
|
-
.map((jwk) => JSON.stringify(jwk))
|
|
265
|
-
)
|
|
266
|
-
).map((jwks) => JSON.parse(jwks))
|
|
248
|
+
? Array.from(new Set(Array.from(
|
|
249
|
+
Object.values(didJwks)
|
|
250
|
+
.filter((jwks) => isDefined(jwks) && jwks.length > 0)
|
|
251
|
+
.flatMap((jwks) => jwks)
|
|
252
|
+
).flatMap((jwk) => {
|
|
253
|
+
return {
|
|
254
|
+
jwk,
|
|
255
|
+
jwkThumbprint: calculateJwkThumbprint({ jwk }),
|
|
256
|
+
kid: jwk.kid,
|
|
257
|
+
publicKeyHex: jwkTtoPublicKeyHex(jwk),
|
|
258
|
+
}
|
|
259
|
+
}).map(jwk => JSON.stringify(jwk)))).map((jwks) => JSON.parse(jwks))
|
|
267
260
|
: []
|
|
268
261
|
|
|
269
262
|
if (didResolutionResult?.didDocument) {
|
|
@@ -2,11 +2,8 @@ import { ErrorMessage, ExternalIdentifierOIDFEntityIdOpts, ExternalIdentifierOID
|
|
|
2
2
|
import { IAgentContext } from '@veramo/core'
|
|
3
3
|
import { IOIDFClient } from '@sphereon/ssi-sdk.oidf-client'
|
|
4
4
|
import { contextHasPlugin } from '@sphereon/ssi-sdk.agent-config'
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { fromString } from 'uint8arrays/from-string'
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
import { toString } from 'uint8arrays/to-string'
|
|
5
|
+
import {IJwsValidationResult, JwsPayload} from '../types/IJwtService'
|
|
6
|
+
import * as u8a from 'uint8arrays'
|
|
10
7
|
/**
|
|
11
8
|
* Resolves an OIDF Entity ID against multiple trust anchors to establish trusted relationships
|
|
12
9
|
*
|
|
@@ -68,7 +65,7 @@ export async function resolveExternalOIDFEntityIdIdentifier(
|
|
|
68
65
|
continue
|
|
69
66
|
}
|
|
70
67
|
|
|
71
|
-
payload = JSON.parse(toString(fromString(jwtVerifyResult.jws.payload, 'base64url')))
|
|
68
|
+
payload = JSON.parse(u8a.toString(u8a.fromString(jwtVerifyResult.jws.payload, 'base64url')))
|
|
72
69
|
const signature = jwtVerifyResult.jws.signatures[0]
|
|
73
70
|
if (signature.identifier.jwks.length === 0) {
|
|
74
71
|
errorList[trustAnchor] = 'No JWK was present in the trust anchor signature'
|
|
@@ -5,7 +5,6 @@ import { contextHasDidManager, contextHasKeyManager } from '@sphereon/ssi-sdk.ag
|
|
|
5
5
|
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types'
|
|
6
6
|
import { IAgentContext, IIdentifier, IKey, IKeyManager } from '@veramo/core'
|
|
7
7
|
import { CryptoEngine, setEngine } from 'pkijs'
|
|
8
|
-
import { webcrypto } from 'node:crypto'
|
|
9
8
|
import {
|
|
10
9
|
IIdentifierResolution,
|
|
11
10
|
isManagedIdentifierCoseKeyOpts,
|
|
@@ -48,13 +47,13 @@ export async function getManagedKidIdentifier(
|
|
|
48
47
|
return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
|
|
49
48
|
} else if (opts.identifier.startsWith('did:')) {
|
|
50
49
|
const did = opts.identifier.split('#')[0]
|
|
51
|
-
const didIdentifier = await getManagedDidIdentifier({
|
|
50
|
+
const didIdentifier = await getManagedDidIdentifier({...opts, method: 'did', identifier: did}, context)
|
|
52
51
|
key = didIdentifier.key
|
|
53
52
|
issuer = didIdentifier.issuer
|
|
54
53
|
kid = opts?.kid ?? (key.meta?.verificationMethod?.id as string) ?? didIdentifier.kid
|
|
55
54
|
}
|
|
56
55
|
if (!key) {
|
|
57
|
-
key = await context.agent.keyManagerGet({
|
|
56
|
+
key = await context.agent.keyManagerGet({kid: opts.kmsKeyRef ?? opts.identifier})
|
|
58
57
|
}
|
|
59
58
|
const jwk = toJwk(key.publicKeyHex, key.type, { key })
|
|
60
59
|
const jwkThumbprint = (key.meta?.jwkThumbprint as string) ?? calculateJwkThumbprint({ jwk })
|
|
@@ -81,7 +80,7 @@ export async function getManagedKidIdentifier(
|
|
|
81
80
|
|
|
82
81
|
export function isManagedIdentifierResult(
|
|
83
82
|
identifier: ManagedIdentifierOptsOrResult & {
|
|
84
|
-
crypto?:
|
|
83
|
+
crypto?: Crypto
|
|
85
84
|
}
|
|
86
85
|
): identifier is ManagedIdentifierResult {
|
|
87
86
|
return 'key' in identifier && 'kmsKeyRef' in identifier && 'method' in identifier && 'opts' in identifier && 'jwkThumbprint' in identifier
|
|
@@ -94,7 +93,7 @@ export function isManagedIdentifierResult(
|
|
|
94
93
|
*/
|
|
95
94
|
export async function ensureManagedIdentifierResult(
|
|
96
95
|
identifier: ManagedIdentifierOptsOrResult & {
|
|
97
|
-
crypto?:
|
|
96
|
+
crypto?: Crypto
|
|
98
97
|
},
|
|
99
98
|
context: IAgentContext<IKeyManager>
|
|
100
99
|
): Promise<ManagedIdentifierResult> {
|
|
@@ -248,7 +247,7 @@ export async function getManagedJwkIdentifier(
|
|
|
248
247
|
|
|
249
248
|
export async function getManagedX5cIdentifier(
|
|
250
249
|
opts: ManagedIdentifierX5cOpts & {
|
|
251
|
-
crypto?:
|
|
250
|
+
crypto?: Crypto
|
|
252
251
|
},
|
|
253
252
|
context: IAgentContext<IKeyManager>
|
|
254
253
|
): Promise<ManagedIdentifierX5cResult> {
|
|
@@ -332,7 +331,7 @@ export async function getManagedOID4VCIssuerIdentifier(
|
|
|
332
331
|
|
|
333
332
|
export async function getManagedIdentifier(
|
|
334
333
|
opts: ManagedIdentifierOptsOrResult & {
|
|
335
|
-
crypto?:
|
|
334
|
+
crypto?: Crypto
|
|
336
335
|
},
|
|
337
336
|
context: IAgentContext<IKeyManager>
|
|
338
337
|
): Promise<ManagedIdentifierResult> {
|
package/src/index.ts
CHANGED
|
@@ -41,7 +41,7 @@ export const identifierResolutionContextMethods: Array<string> = [
|
|
|
41
41
|
'identifierManagedGetByX5c',
|
|
42
42
|
'identifierManagedGetByKey',
|
|
43
43
|
'identifierManagedGetByOID4VCIssuer',
|
|
44
|
-
'
|
|
44
|
+
'identifierGetManagedByCoseKey',
|
|
45
45
|
'identifierExternalResolve',
|
|
46
46
|
'identifierExternalResolveByDid',
|
|
47
47
|
'identifierExternalResolveByX5c',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copy of jwt-service typings since we cannot include that as devDependency due to cyclic dep
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import {
|
|
4
4
|
ExternalIdentifierDidOpts,
|
|
5
5
|
ExternalIdentifierResult,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
IIdentifierResolution,
|
|
8
8
|
ManagedIdentifierOptsOrResult,
|
|
9
9
|
ManagedIdentifierResult,
|
|
10
|
-
} from '
|
|
10
|
+
} from '@sphereon/ssi-sdk-ext.identifier-resolution'
|
|
11
11
|
import { ClientIdScheme } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
12
12
|
import { BaseJWK, IValidationResult, JoseSignatureAlgorithm, JoseSignatureAlgorithmString, JWK } from '@sphereon/ssi-types'
|
|
13
13
|
import { IAgentContext, IKeyManager, IPluginMethodMap } from '@veramo/core'
|
|
@@ -25,7 +25,6 @@ export interface IJwtService extends IPluginMethodMap {
|
|
|
25
25
|
export type IJwsValidationResult = IValidationResult & {
|
|
26
26
|
jws: JwsJsonGeneralWithIdentifiers
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
export interface PreparedJws {
|
|
30
29
|
protectedHeader: JwsHeader
|
|
31
30
|
payload: Uint8Array
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
isX5cIdentifier,
|
|
15
15
|
JwkInfo,
|
|
16
16
|
} from './common'
|
|
17
|
-
import {
|
|
17
|
+
import {JwsPayload} from "./IJwtService";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Use whenever we need to resolve an external identifier. We can pass in kids, DIDs, and x5chains
|