@sphereon/ssi-sdk-ext.identifier-resolution 0.24.1-next.97 → 0.24.1-unstable.111
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 +3 -0
- package/dist/agent/IdentifierResolution.d.ts.map +1 -1
- package/dist/agent/IdentifierResolution.js +19 -1
- package/dist/agent/IdentifierResolution.js.map +1 -1
- package/dist/functions/LegacySupport.d.ts +12 -0
- package/dist/functions/LegacySupport.d.ts.map +1 -0
- package/dist/functions/LegacySupport.js +40 -0
- package/dist/functions/LegacySupport.js.map +1 -0
- package/dist/functions/externalIdentifierFunctions.d.ts +17 -1
- package/dist/functions/externalIdentifierFunctions.d.ts.map +1 -1
- package/dist/functions/externalIdentifierFunctions.js +82 -2
- package/dist/functions/externalIdentifierFunctions.js.map +1 -1
- package/dist/functions/index.d.ts +1 -11
- package/dist/functions/index.d.ts.map +1 -1
- package/dist/functions/index.js +1 -36
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/managedIdentifierFunctions.d.ts +16 -5
- package/dist/functions/managedIdentifierFunctions.d.ts.map +1 -1
- package/dist/functions/managedIdentifierFunctions.js +66 -6
- package/dist/functions/managedIdentifierFunctions.js.map +1 -1
- package/dist/types/IIdentifierResolution.d.ts +10 -3
- package/dist/types/IIdentifierResolution.d.ts.map +1 -1
- package/dist/types/IIdentifierResolution.js +3 -0
- package/dist/types/IIdentifierResolution.js.map +1 -1
- package/dist/types/common.d.ts +2 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +5 -1
- package/dist/types/common.js.map +1 -1
- package/dist/types/externalIdentifierTypes.d.ts +23 -6
- package/dist/types/externalIdentifierTypes.d.ts.map +1 -1
- package/dist/types/externalIdentifierTypes.js +6 -1
- package/dist/types/externalIdentifierTypes.js.map +1 -1
- package/dist/types/managedIdentifierTypes.d.ts +29 -7
- package/dist/types/managedIdentifierTypes.d.ts.map +1 -1
- package/dist/types/managedIdentifierTypes.js +10 -1
- package/dist/types/managedIdentifierTypes.js.map +1 -1
- package/package.json +12 -12
- package/plugin.schema.json +2126 -222
- package/src/agent/IdentifierResolution.ts +56 -10
- package/src/functions/LegacySupport.ts +54 -0
- package/src/functions/externalIdentifierFunctions.ts +94 -4
- package/src/functions/index.ts +1 -51
- package/src/functions/managedIdentifierFunctions.ts +79 -10
- package/src/types/IIdentifierResolution.ts +24 -2
- package/src/types/common.ts +5 -1
- package/src/types/externalIdentifierTypes.ts +54 -13
- package/src/types/managedIdentifierTypes.ts +47 -8
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import { IAgentContext, IDIDManager, IKeyManager, IPluginMethodMap } from '@veramo/core'
|
|
2
2
|
import {
|
|
3
|
+
ExternalIdentifierCoseKeyOpts,
|
|
4
|
+
ExternalIdentifierCoseKeyResult,
|
|
3
5
|
ExternalIdentifierDidOpts,
|
|
4
6
|
ExternalIdentifierDidResult,
|
|
7
|
+
ExternalIdentifierJwkOpts,
|
|
8
|
+
ExternalIdentifierJwkResult,
|
|
5
9
|
ExternalIdentifierOpts,
|
|
6
10
|
ExternalIdentifierResult,
|
|
7
11
|
ExternalIdentifierX5cOpts,
|
|
8
12
|
ExternalIdentifierX5cResult,
|
|
9
13
|
} from './externalIdentifierTypes'
|
|
10
14
|
import {
|
|
15
|
+
ManagedIdentifierCoseKeyOpts,
|
|
16
|
+
ManagedIdentifierCoseKeyResult,
|
|
11
17
|
ManagedIdentifierDidOpts,
|
|
12
18
|
ManagedIdentifierDidResult,
|
|
13
19
|
ManagedIdentifierJwkOpts,
|
|
@@ -16,7 +22,7 @@ import {
|
|
|
16
22
|
ManagedIdentifierKeyResult,
|
|
17
23
|
ManagedIdentifierKidOpts,
|
|
18
24
|
ManagedIdentifierKidResult,
|
|
19
|
-
|
|
25
|
+
ManagedIdentifierOptsOrResult,
|
|
20
26
|
ManagedIdentifierResult,
|
|
21
27
|
ManagedIdentifierX5cOpts,
|
|
22
28
|
ManagedIdentifierX5cResult,
|
|
@@ -30,9 +36,12 @@ export const identifierResolutionContextMethods: Array<string> = [
|
|
|
30
36
|
'identifierManagedGetByJwk',
|
|
31
37
|
'identifierManagedGetByX5c',
|
|
32
38
|
'identifierManagedGetByKey',
|
|
39
|
+
'identifierGetManagedByCoseKey',
|
|
33
40
|
'identifierExternalResolve',
|
|
34
41
|
'identifierExternalResolveByDid',
|
|
35
42
|
'identifierExternalResolveByX5c',
|
|
43
|
+
'identifierExternalResolveByJwk',
|
|
44
|
+
'identifierExternalResolveByCoseKey',
|
|
36
45
|
]
|
|
37
46
|
|
|
38
47
|
/**
|
|
@@ -43,11 +52,15 @@ export interface IIdentifierResolution extends IPluginMethodMap {
|
|
|
43
52
|
* Main method for managed identifiers. We always go through this method (also the others) as we want to integrate a plugin for anomaly detection. Having a single method helps
|
|
44
53
|
*
|
|
45
54
|
* The end result of all these methods is a common baseline response that allows to use a key from the registered KMS systems. It also provides kid and iss(uer) values that can be used in a JWT/JWS for instance
|
|
55
|
+
* Allows to get a managed identifier result in case identifier options are passed in, but returns the identifier directly in case results are passed in. This means resolution can have happened before, or happens in this method
|
|
56
|
+
*
|
|
57
|
+
* We use the opts or result type almost everywhere, as it allows for just in time resolution whenever this method is called and afterwards we have the result, so resolution doesn't have to hit the DB, or external endpoints.
|
|
58
|
+
* Also use this method in the local agent, not using REST. If case the identifier needs to be resolved, you can always have the above methods using REST
|
|
46
59
|
* @param args
|
|
47
60
|
* @param context
|
|
48
61
|
* @public
|
|
49
62
|
*/
|
|
50
|
-
identifierManagedGet(args:
|
|
63
|
+
identifierManagedGet(args: ManagedIdentifierOptsOrResult, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierResult>
|
|
51
64
|
|
|
52
65
|
identifierManagedGetByDid(args: ManagedIdentifierDidOpts, context: IAgentContext<IKeyManager & IDIDManager>): Promise<ManagedIdentifierDidResult>
|
|
53
66
|
|
|
@@ -59,6 +72,11 @@ export interface IIdentifierResolution extends IPluginMethodMap {
|
|
|
59
72
|
|
|
60
73
|
identifierManagedGetByKey(args: ManagedIdentifierKeyOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierKeyResult>
|
|
61
74
|
|
|
75
|
+
identifierManagedGetByCoseKey(
|
|
76
|
+
args: ManagedIdentifierCoseKeyOpts,
|
|
77
|
+
context: IAgentContext<IKeyManager & IIdentifierResolution>
|
|
78
|
+
): Promise<ManagedIdentifierCoseKeyResult>
|
|
79
|
+
|
|
62
80
|
// TODO: We can create a custom managed identifier method allowing developers to register a callback function to get their implementation hooked up. Needs more investigation as it would also impact the KMS
|
|
63
81
|
|
|
64
82
|
/**
|
|
@@ -71,5 +89,9 @@ export interface IIdentifierResolution extends IPluginMethodMap {
|
|
|
71
89
|
|
|
72
90
|
identifierExternalResolveByDid(args: ExternalIdentifierDidOpts, context: IAgentContext<any>): Promise<ExternalIdentifierDidResult>
|
|
73
91
|
|
|
92
|
+
identifierExternalResolveByJwk(args: ExternalIdentifierJwkOpts, context: IAgentContext<any>): Promise<ExternalIdentifierJwkResult>
|
|
93
|
+
|
|
94
|
+
identifierExternalResolveByCoseKey(args: ExternalIdentifierCoseKeyOpts, context: IAgentContext<any>): Promise<ExternalIdentifierCoseKeyResult>
|
|
95
|
+
|
|
74
96
|
identifierExternalResolveByX5c(args: ExternalIdentifierX5cOpts, context: IAgentContext<any>): Promise<ExternalIdentifierX5cResult>
|
|
75
97
|
}
|
package/src/types/common.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JWK } from '@sphereon/ssi-
|
|
1
|
+
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types'
|
|
2
2
|
import { IIdentifier, IKey } from '@veramo/core'
|
|
3
3
|
import { ExternalIdentifierType } from './externalIdentifierTypes'
|
|
4
4
|
import { ManagedIdentifierType } from './managedIdentifierTypes'
|
|
@@ -42,6 +42,10 @@ export function isKeyIdentifier(identifier: ManagedIdentifierType): identifier i
|
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
export function isCoseKeyIdentifier(identifier: ManagedIdentifierType): identifier is ICoseKeyJson {
|
|
46
|
+
return typeof identifier === 'object' && `kty` in identifier && ('baseIV' in identifier || 'x5chain' in identifier) && !('x5c' in identifier)
|
|
47
|
+
}
|
|
48
|
+
|
|
45
49
|
export function isX5cIdentifier(identifier: ManagedIdentifierType | ExternalIdentifierType): identifier is string[] {
|
|
46
50
|
return Array.isArray(identifier) && identifier.length > 0 // todo: Do we want to do additional validation? We know it must be DER and thus hex for instance
|
|
47
51
|
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { DidDocumentJwks } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
2
|
-
import { JWK } from '@sphereon/ssi-
|
|
3
|
-
import { X509ValidationResult } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
2
|
+
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types'
|
|
3
|
+
import { X509CertificateChainValidationOpts, X509ValidationResult } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
4
4
|
import { IParsedDID } from '@sphereon/ssi-types'
|
|
5
5
|
import { DIDDocument, DIDDocumentSection, DIDResolutionResult } from '@veramo/core'
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
isCoseKeyIdentifier,
|
|
8
|
+
isDidIdentifier,
|
|
9
|
+
isJwkIdentifier,
|
|
10
|
+
isJwksUrlIdentifier,
|
|
11
|
+
isKidIdentifier,
|
|
12
|
+
isOidcDiscoveryIdentifier,
|
|
13
|
+
isX5cIdentifier,
|
|
14
|
+
JwkInfo,
|
|
15
|
+
} from './common'
|
|
7
16
|
|
|
8
17
|
/**
|
|
9
18
|
* Use whenever we need to resolve an external identifier. We can pass in kids, DIDs, and x5chains
|
|
@@ -32,7 +41,13 @@ export function isExternalIdentifierDidOpts(opts: ExternalIdentifierOptsBase): o
|
|
|
32
41
|
return ('method' in opts && opts.method === 'did') || isDidIdentifier(identifier)
|
|
33
42
|
}
|
|
34
43
|
|
|
35
|
-
export type ExternalIdentifierOpts = (
|
|
44
|
+
export type ExternalIdentifierOpts = (
|
|
45
|
+
| ExternalIdentifierJwkOpts
|
|
46
|
+
| ExternalIdentifierX5cOpts
|
|
47
|
+
| ExternalIdentifierDidOpts
|
|
48
|
+
| ExternalIdentifierKidOpts
|
|
49
|
+
| ExternalIdentifierCoseKeyOpts
|
|
50
|
+
) &
|
|
36
51
|
ExternalIdentifierOptsBase
|
|
37
52
|
|
|
38
53
|
export type ExternalIdentifierKidOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
@@ -48,6 +63,7 @@ export function isExternalIdentifierKidOpts(opts: ExternalIdentifierOptsBase): o
|
|
|
48
63
|
export type ExternalIdentifierJwkOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
49
64
|
method?: 'jwk'
|
|
50
65
|
identifier: JWK
|
|
66
|
+
x5c?: ExternalIdentifierX5cOpts
|
|
51
67
|
}
|
|
52
68
|
|
|
53
69
|
export function isExternalIdentifierJwkOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierJwkOpts {
|
|
@@ -55,6 +71,16 @@ export function isExternalIdentifierJwkOpts(opts: ExternalIdentifierOptsBase): o
|
|
|
55
71
|
return ('method' in opts && opts.method === 'jwk') || isJwkIdentifier(identifier)
|
|
56
72
|
}
|
|
57
73
|
|
|
74
|
+
export type ExternalIdentifierCoseKeyOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
75
|
+
method?: 'cose_key'
|
|
76
|
+
identifier: ICoseKeyJson
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function isExternalIdentifierCoseKeyOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierCoseKeyOpts {
|
|
80
|
+
const { identifier } = opts
|
|
81
|
+
return ('method' in opts && opts.method === 'cose_key') || isCoseKeyIdentifier(identifier)
|
|
82
|
+
}
|
|
83
|
+
|
|
58
84
|
export type ExternalIdentifierOidcDiscoveryOpts = Omit<ExternalIdentifierOptsBase, 'method'> & {
|
|
59
85
|
method?: 'oidc-discovery'
|
|
60
86
|
identifier: string
|
|
@@ -75,28 +101,42 @@ export function isExternalIdentifierJwksUrlOpts(opts: ExternalIdentifierOptsBase
|
|
|
75
101
|
return ('method' in opts && opts.method === 'oidc-discovery') || isJwksUrlIdentifier(identifier)
|
|
76
102
|
}
|
|
77
103
|
|
|
78
|
-
export type ExternalIdentifierX5cOpts = Omit<ExternalIdentifierOptsBase, 'method'> &
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
export type ExternalIdentifierX5cOpts = Omit<ExternalIdentifierOptsBase, 'method'> &
|
|
105
|
+
X509CertificateChainValidationOpts & {
|
|
106
|
+
method?: 'x5c'
|
|
107
|
+
identifier: string[]
|
|
108
|
+
verify?: boolean // defaults to true
|
|
109
|
+
verificationTime?: Date
|
|
110
|
+
trustAnchors?: string[]
|
|
111
|
+
}
|
|
85
112
|
|
|
86
113
|
export function isExternalIdentifierX5cOpts(opts: ExternalIdentifierOptsBase): opts is ExternalIdentifierX5cOpts {
|
|
87
114
|
const { identifier } = opts
|
|
88
115
|
return ('method' in opts && opts.method === 'x5c') || isX5cIdentifier(identifier)
|
|
89
116
|
}
|
|
90
117
|
|
|
91
|
-
export type ExternalIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'oidc-discovery' | 'jwks-url' | 'oid4vci-issuer'
|
|
118
|
+
export type ExternalIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'cose_key' | 'oidc-discovery' | 'jwks-url' | 'oid4vci-issuer'
|
|
92
119
|
|
|
93
|
-
export type ExternalIdentifierResult =
|
|
120
|
+
export type ExternalIdentifierResult = IExternalIdentifierResultBase &
|
|
121
|
+
(ExternalIdentifierDidResult | ExternalIdentifierX5cResult | ExternalIdentifierJwkResult | ExternalIdentifierCoseKeyResult)
|
|
94
122
|
|
|
95
123
|
export interface IExternalIdentifierResultBase {
|
|
96
124
|
method: ExternalIdentifierMethod
|
|
97
125
|
jwks: Array<ExternalJwkInfo>
|
|
98
126
|
}
|
|
99
127
|
|
|
128
|
+
export interface ExternalIdentifierJwkResult extends IExternalIdentifierResultBase {
|
|
129
|
+
method: 'jwk'
|
|
130
|
+
jwk: JWK
|
|
131
|
+
x5c?: ExternalIdentifierX5cResult
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface ExternalIdentifierCoseKeyResult extends IExternalIdentifierResultBase {
|
|
135
|
+
method: 'cose_key'
|
|
136
|
+
coseKey: ICoseKeyJson
|
|
137
|
+
x5c?: ExternalIdentifierX5cResult
|
|
138
|
+
}
|
|
139
|
+
|
|
100
140
|
export interface ExternalIdentifierX5cResult extends IExternalIdentifierResultBase {
|
|
101
141
|
method: 'x5c'
|
|
102
142
|
x5c: string[]
|
|
@@ -107,6 +147,7 @@ export interface ExternalIdentifierX5cResult extends IExternalIdentifierResultBa
|
|
|
107
147
|
|
|
108
148
|
export interface ExternalJwkInfo extends JwkInfo {
|
|
109
149
|
kid?: string
|
|
150
|
+
publicKeyHex: string
|
|
110
151
|
}
|
|
111
152
|
|
|
112
153
|
export interface ExternalIdentifierDidResult extends IExternalIdentifierResultBase {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ClientIdScheme } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
2
|
+
import { ICoseKeyJson, JWK } from '@sphereon/ssi-types'
|
|
2
3
|
import { DIDDocumentSection, IIdentifier, IKey, TKeyType } from '@veramo/core'
|
|
3
|
-
import { isDidIdentifier, isJwkIdentifier, isKeyIdentifier, isKidIdentifier, isX5cIdentifier, JwkInfo } from './common'
|
|
4
|
+
import { isCoseKeyIdentifier, isDidIdentifier, isJwkIdentifier, isKeyIdentifier, isKidIdentifier, isX5cIdentifier, JwkInfo } from './common'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Use whenever we need to pass in an identifier. We can pass in kids, DIDs, IIdentifier objects and x5chains
|
|
7
8
|
*
|
|
8
9
|
* The functions below can be used to check the type, and they also provide the proper 'runtime' types
|
|
9
10
|
*/
|
|
10
|
-
export type ManagedIdentifierType = IIdentifier /*did*/ | string /*did or kid*/ | string[] /*x5c*/ | JWK | IKey
|
|
11
|
+
export type ManagedIdentifierType = IIdentifier /*did*/ | string /*did or kid*/ | string[] /*x5c*/ | JWK | IKey | ICoseKeyJson
|
|
11
12
|
|
|
12
13
|
export type ManagedIdentifierOpts = (
|
|
13
14
|
| ManagedIdentifierJwkOpts
|
|
@@ -15,6 +16,7 @@ export type ManagedIdentifierOpts = (
|
|
|
15
16
|
| ManagedIdentifierDidOpts
|
|
16
17
|
| ManagedIdentifierKidOpts
|
|
17
18
|
| ManagedIdentifierKeyOpts
|
|
19
|
+
| ManagedIdentifierCoseKeyOpts
|
|
18
20
|
) &
|
|
19
21
|
ManagedIdentifierOptsBase
|
|
20
22
|
|
|
@@ -24,6 +26,8 @@ export type ManagedIdentifierOptsBase = {
|
|
|
24
26
|
kmsKeyRef?: string // The key reference for the KMS system. If provided this value will be used to determine the appropriate key. Otherwise it will be inferred
|
|
25
27
|
issuer?: string // can be used when a specific issuer needs to end up, for instance when signing JWTs. Will be returned or inferred if not provided
|
|
26
28
|
kid?: string // can be used when a specific kid value needs to be used. For instance when signing JWTs. Will be returned or inferred if not provided
|
|
29
|
+
clientId?: string
|
|
30
|
+
clientIdScheme?: ClientIdScheme | 'did' | string
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
export type ManagedIdentifierDidOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
|
|
@@ -56,11 +60,21 @@ export type ManagedIdentifierKeyOpts = Omit<ManagedIdentifierOptsBase, 'method'>
|
|
|
56
60
|
identifier: IKey
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
export function isManagedIdentifierKeyOpts(opts: ManagedIdentifierOptsBase): opts is
|
|
63
|
+
export function isManagedIdentifierKeyOpts(opts: ManagedIdentifierOptsBase): opts is ManagedIdentifierKeyOpts {
|
|
60
64
|
const { identifier } = opts
|
|
61
65
|
return ('method' in opts && opts.method === 'key') || isKeyIdentifier(identifier)
|
|
62
66
|
}
|
|
63
67
|
|
|
68
|
+
export type ManagedIdentifierCoseKeyOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
|
|
69
|
+
method?: 'cose_key'
|
|
70
|
+
identifier: ICoseKeyJson
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function isManagedIdentifierCoseKeyOpts(opts: ManagedIdentifierOptsBase): opts is ManagedIdentifierCoseKeyOpts {
|
|
74
|
+
const { identifier } = opts
|
|
75
|
+
return ('method' in opts && opts.method === 'cose_key') || isCoseKeyIdentifier(identifier)
|
|
76
|
+
}
|
|
77
|
+
|
|
64
78
|
export type ManagedIdentifierJwkOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
|
|
65
79
|
method?: 'jwk'
|
|
66
80
|
identifier: JWK
|
|
@@ -91,6 +105,9 @@ export interface IManagedIdentifierResultBase extends ManagedJwkInfo {
|
|
|
91
105
|
key: IKey
|
|
92
106
|
kid?: string
|
|
93
107
|
issuer?: string
|
|
108
|
+
clientId?: string
|
|
109
|
+
clientIdScheme?: ClientIdScheme | 'did' | string
|
|
110
|
+
identifier: ManagedIdentifierType
|
|
94
111
|
}
|
|
95
112
|
|
|
96
113
|
export function isManagedIdentifierDidResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierDidResult {
|
|
@@ -113,6 +130,10 @@ export function isManagedIdentifierKeyResult(object: IManagedIdentifierResultBas
|
|
|
113
130
|
return object!! && typeof object === 'object' && 'method' in object && object.method === 'key'
|
|
114
131
|
}
|
|
115
132
|
|
|
133
|
+
export function isManagedIdentifierCoseKeyResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierCoseKeyResult {
|
|
134
|
+
return object!! && typeof object === 'object' && 'method' in object && object.method === 'cose_key'
|
|
135
|
+
}
|
|
136
|
+
|
|
116
137
|
export interface ManagedIdentifierDidResult extends IManagedIdentifierResultBase {
|
|
117
138
|
method: 'did'
|
|
118
139
|
identifier: IIdentifier
|
|
@@ -126,27 +147,45 @@ export interface ManagedIdentifierDidResult extends IManagedIdentifierResultBase
|
|
|
126
147
|
}
|
|
127
148
|
|
|
128
149
|
export interface ManagedIdentifierJwkResult extends IManagedIdentifierResultBase {
|
|
150
|
+
identifier: JWK
|
|
129
151
|
method: 'jwk'
|
|
130
152
|
}
|
|
131
153
|
|
|
132
154
|
export interface ManagedIdentifierKidResult extends IManagedIdentifierResultBase {
|
|
133
155
|
method: 'kid'
|
|
156
|
+
identifier: string
|
|
134
157
|
kid: string
|
|
135
158
|
}
|
|
136
159
|
|
|
137
160
|
export interface ManagedIdentifierKeyResult extends IManagedIdentifierResultBase {
|
|
138
161
|
method: 'key'
|
|
162
|
+
identifier: IKey
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface ManagedIdentifierCoseKeyResult extends IManagedIdentifierResultBase {
|
|
166
|
+
method: 'cose_key'
|
|
167
|
+
identifier: ICoseKeyJson
|
|
139
168
|
}
|
|
140
169
|
|
|
141
170
|
export interface ManagedIdentifierX5cResult extends IManagedIdentifierResultBase {
|
|
142
171
|
method: 'x5c'
|
|
172
|
+
identifier: string[]
|
|
143
173
|
x5c: string[]
|
|
144
174
|
certificate: any // Certificate(JSON_, but trips schema generator. Probably want to create our own DTO
|
|
145
175
|
}
|
|
146
176
|
|
|
147
|
-
export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'key'
|
|
177
|
+
export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'key' | 'cose_key'
|
|
148
178
|
|
|
149
179
|
export type ManagedIdentifierResult = IManagedIdentifierResultBase &
|
|
150
|
-
(
|
|
151
|
-
|
|
152
|
-
|
|
180
|
+
(
|
|
181
|
+
| ManagedIdentifierX5cResult
|
|
182
|
+
| ManagedIdentifierDidResult
|
|
183
|
+
| ManagedIdentifierJwkResult
|
|
184
|
+
| ManagedIdentifierKidResult
|
|
185
|
+
| ManagedIdentifierKeyResult
|
|
186
|
+
| ManagedIdentifierCoseKeyResult
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
export type ManagedIdentifierOptsOrResult = (ManagedIdentifierResult | ManagedIdentifierOpts) & {
|
|
190
|
+
lazyDisabled?: boolean
|
|
191
|
+
}
|