@sphereon/ssi-sdk-ext.identifier-resolution 0.24.1-unstable.76 → 0.24.1-unstable.77

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.
@@ -1,5 +1,11 @@
1
1
  import { IAgentContext, IKeyManager } from '@veramo/core';
2
- import { ManagedIdentifierOpts, ManagedIdentifierResult } from '../types';
2
+ import { ManagedIdentifierDidOpts, ManagedIdentifierDidResult, ManagedIdentifierJwkOpts, ManagedIdentifierJwkResult, ManagedIdentifierKidOpts, ManagedIdentifierKidResult, ManagedIdentifierOpts, ManagedIdentifierResult, ManagedIdentifierX5cOpts, ManagedIdentifierX5cResult } from '../types';
3
+ export declare function getManagedKidIdentifier(opts: ManagedIdentifierKidOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierKidResult>;
4
+ export declare function getManagedDidIdentifier(opts: ManagedIdentifierDidOpts, context: IAgentContext<any>): Promise<ManagedIdentifierDidResult>;
5
+ export declare function getManagedJwkIdentifier(opts: ManagedIdentifierJwkOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierJwkResult>;
6
+ export declare function getManagedX5cIdentifier(opts: ManagedIdentifierX5cOpts & {
7
+ crypto?: Crypto;
8
+ }, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierX5cResult>;
3
9
  export declare function getManagedIdentifier(opts: ManagedIdentifierOpts & {
4
10
  crypto?: Crypto;
5
11
  }, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"managedIdentifierFunctions.d.ts","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAqB,WAAW,EAAE,MAAM,cAAc,CAAA;AAE5E,OAAO,EAKL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,UAAU,CAAA;AAEjB,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,qBAAqB,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,uBAAuB,CAAC,CAoFlC"}
1
+ {"version":3,"file":"managedIdentifierFunctions.d.ts","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAe,WAAW,EAAE,MAAM,cAAc,CAAA;AAEtE,OAAO,EAML,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AAEjB,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,wBAAwB,EAC9B,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,0BAA0B,CAAC,CAmBrC;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,0BAA0B,CAAC,CA0C9I;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,wBAAwB,EAC9B,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,0BAA0B,CAAC,CAmBrC;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,wBAAwB,GAAG;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,0BAA0B,CAAC,CA8BrC;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,qBAAqB,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,uBAAuB,CAAC,CAmBlC"}
@@ -9,87 +9,159 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getManagedIdentifier = void 0;
12
+ exports.getManagedIdentifier = exports.getManagedX5cIdentifier = exports.getManagedJwkIdentifier = exports.getManagedDidIdentifier = exports.getManagedKidIdentifier = void 0;
13
13
  const ssi_sdk_ext_did_utils_1 = require("@sphereon/ssi-sdk-ext.did-utils");
14
14
  const ssi_sdk_ext_key_utils_1 = require("@sphereon/ssi-sdk-ext.key-utils");
15
15
  const ssi_sdk_ext_x509_utils_1 = require("@sphereon/ssi-sdk-ext.x509-utils");
16
16
  const ssi_sdk_agent_config_1 = require("@sphereon/ssi-sdk.agent-config");
17
17
  const pkijs_1 = require("pkijs");
18
18
  const types_1 = require("../types");
19
- function getManagedIdentifier(opts, context) {
19
+ function getManagedKidIdentifier(opts, context) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ var _a, _b, _c, _d, _e, _f, _g, _h;
22
+ const method = 'kid';
23
+ if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
24
+ return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`));
25
+ }
26
+ const key = yield context.agent.keyManagerGet({ kid: (_a = opts.kmsKeyRef) !== null && _a !== void 0 ? _a : opts.identifier });
27
+ const jwk = (0, ssi_sdk_ext_key_utils_1.toJwk)(key.publicKeyHex, key.type, { key });
28
+ const jwkThumbprint = (_c = (_b = key.meta) === null || _b === void 0 ? void 0 : _b.jwkThumbprint) !== null && _c !== void 0 ? _c : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
29
+ const kid = (_g = (_d = opts.kid) !== null && _d !== void 0 ? _d : (_f = (_e = key.meta) === null || _e === void 0 ? void 0 : _e.verificationMethod) === null || _f === void 0 ? void 0 : _f.id) !== null && _g !== void 0 ? _g : jwkThumbprint;
30
+ const issuer = (_h = opts.issuer) !== null && _h !== void 0 ? _h : kid; // The different identifiers should set the value. Defaults to the kid
31
+ return {
32
+ method,
33
+ key,
34
+ jwk,
35
+ jwkThumbprint,
36
+ kid,
37
+ issuer,
38
+ kmsKeyRef: key.kid,
39
+ };
40
+ });
41
+ }
42
+ exports.getManagedKidIdentifier = getManagedKidIdentifier;
43
+ function getManagedDidIdentifier(opts, context) {
20
44
  return __awaiter(this, void 0, void 0, function* () {
21
45
  var _a, _b, _c, _d, _e, _f, _g;
22
- let { method } = opts;
23
- let identifier = undefined;
24
- let keys = undefined;
25
- let key = undefined;
26
- let certificate = undefined;
27
- let jwk = undefined;
28
- let jwkThumbprint = undefined;
29
- let x5c;
30
- let controllerKeyId = undefined;
31
- let did = undefined;
46
+ const method = 'did';
47
+ if (!(0, ssi_sdk_agent_config_1.contextHasDidManager)(context)) {
48
+ return Promise.reject(Error(`Cannot get DID identifier if DID Manager plugin is not enabled!`));
49
+ }
50
+ let identifier;
51
+ if (typeof opts.identifier === 'string') {
52
+ identifier = yield context.agent.didManagerGet({ did: opts.identifier.split('#')[0] });
53
+ }
54
+ else {
55
+ identifier = opts.identifier;
56
+ }
57
+ const did = identifier.did;
58
+ const keys = identifier === null || identifier === void 0 ? void 0 : identifier.keys; // fixme: We really want to return the vmRelationship keys here actually
59
+ const extendedKey = yield (0, ssi_sdk_ext_did_utils_1.getFirstKeyWithRelation)(Object.assign(Object.assign({}, opts), { identifier, vmRelationship: (_a = opts.vmRelationship) !== null && _a !== void 0 ? _a : 'verificationMethod' }), context);
60
+ const key = extendedKey;
61
+ const controllerKeyId = identifier.controllerKeyId;
62
+ const jwk = (0, ssi_sdk_ext_key_utils_1.toJwk)(key.publicKeyHex, key.type, { key });
63
+ const jwkThumbprint = (_c = (_b = key.meta) === null || _b === void 0 ? void 0 : _b.jwkThumbprint) !== null && _c !== void 0 ? _c : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
64
+ const kid = (_d = opts.kid) !== null && _d !== void 0 ? _d : (_f = (_e = extendedKey.meta) === null || _e === void 0 ? void 0 : _e.verificationMethod) === null || _f === void 0 ? void 0 : _f.id;
65
+ const issuer = (_g = opts.issuer) !== null && _g !== void 0 ? _g : did;
66
+ return {
67
+ method,
68
+ key,
69
+ did,
70
+ kmsKeyRef: key.kid,
71
+ jwk,
72
+ jwkThumbprint,
73
+ controllerKeyId,
74
+ kid,
75
+ keys,
76
+ issuer,
77
+ identifier,
78
+ };
79
+ });
80
+ }
81
+ exports.getManagedDidIdentifier = getManagedDidIdentifier;
82
+ function getManagedJwkIdentifier(opts, context) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ var _a, _b, _c, _d;
85
+ const method = 'jwk';
86
+ const { kid, issuer } = opts;
87
+ if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
88
+ return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`));
89
+ }
90
+ const key = yield context.agent.keyManagerGet({ kid: (_a = opts.kmsKeyRef) !== null && _a !== void 0 ? _a : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk: opts.identifier }) });
91
+ const jwk = (_b = opts.identifier) !== null && _b !== void 0 ? _b : (0, ssi_sdk_ext_key_utils_1.toJwk)(key.publicKeyHex, key.type, { key });
92
+ const jwkThumbprint = (_d = (_c = key.meta) === null || _c === void 0 ? void 0 : _c.jwkThumbprint) !== null && _d !== void 0 ? _d : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
93
+ // we explicitly do not set the kid and issuer, meaning it can remain null. Normally you do not provide a kid and issuer with Jwks.
94
+ return {
95
+ method,
96
+ key,
97
+ kmsKeyRef: key.kid,
98
+ jwk,
99
+ jwkThumbprint,
100
+ kid,
101
+ issuer,
102
+ };
103
+ });
104
+ }
105
+ exports.getManagedJwkIdentifier = getManagedJwkIdentifier;
106
+ function getManagedX5cIdentifier(opts, context) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ var _a, _b;
109
+ const { kid, issuer } = opts;
110
+ const method = 'x5c';
111
+ const x5c = opts.identifier;
112
+ if (x5c.length === 0) {
113
+ return Promise.reject(`Cannot resolve x5c when an empty x5c is passed in`);
114
+ }
115
+ else if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
116
+ return Promise.reject(Error(`Cannot get X5c identifier if KeyManager plugin is not enabled!`));
117
+ }
32
118
  const cryptoImpl = (_a = opts.crypto) !== null && _a !== void 0 ? _a : crypto;
119
+ const certificate = (0, ssi_sdk_ext_x509_utils_1.pemOrDerToX509Certificate)(x5c[0]);
120
+ const cryptoEngine = new pkijs_1.CryptoEngine({ name: 'identifier_resolver_managed', crypto: cryptoImpl });
121
+ (0, pkijs_1.setEngine)(cryptoEngine.name, cryptoEngine);
122
+ const pk = yield certificate.getPublicKey(undefined, cryptoEngine);
123
+ const jwk = (yield cryptoEngine.subtle.exportKey('jwk', pk));
124
+ const jwkThumbprint = (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
125
+ const key = yield context.agent.keyManagerGet({ kid: (_b = opts.kmsKeyRef) !== null && _b !== void 0 ? _b : jwkThumbprint });
126
+ // we explicitly do not set the kid and issuer, meaning it can remain null. Normally you do not provide a kid and issuer with x5c.
127
+ return {
128
+ method,
129
+ x5c,
130
+ certificate,
131
+ jwk,
132
+ jwkThumbprint,
133
+ key,
134
+ kmsKeyRef: key.kid,
135
+ kid,
136
+ issuer,
137
+ };
138
+ });
139
+ }
140
+ exports.getManagedX5cIdentifier = getManagedX5cIdentifier;
141
+ function getManagedIdentifier(opts, context) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ let resolutionResult;
33
144
  if ((0, types_1.isManagedIdentifierKidOpts)(opts)) {
34
- method = 'kid';
35
- if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
36
- return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`));
37
- }
38
- key = yield context.agent.keyManagerGet({ kid: (_b = opts.kmsKeyRef) !== null && _b !== void 0 ? _b : opts.identifier });
145
+ resolutionResult = yield getManagedKidIdentifier(opts, context);
39
146
  }
40
147
  else if ((0, types_1.isManagedIdentifierDidOpts)(opts)) {
41
- method = 'did';
42
- if (!(0, ssi_sdk_agent_config_1.contextHasDidManager)(context)) {
43
- return Promise.reject(Error(`Cannot get DID identifier if DID Manager plugin is not enabled!`));
44
- }
45
- if (typeof opts.identifier === 'string') {
46
- identifier = yield context.agent.didManagerGet({ did: opts.identifier.split('#')[0] });
47
- }
48
- else {
49
- identifier = opts.identifier;
50
- }
51
- if (identifier) {
52
- did = identifier.did;
53
- keys = identifier === null || identifier === void 0 ? void 0 : identifier.keys; // fixme: We really want to return the vmRelationship keys here actually
54
- key = yield (0, ssi_sdk_ext_did_utils_1.getFirstKeyWithRelation)(Object.assign(Object.assign({}, opts), { identifier, vmRelationship: (_c = opts.vmRelationship) !== null && _c !== void 0 ? _c : 'verificationMethod' }), context);
55
- controllerKeyId = identifier.controllerKeyId;
56
- }
148
+ resolutionResult = yield getManagedDidIdentifier(opts, context);
57
149
  }
58
150
  else if ((0, types_1.isManagedIdentifierJwkOpts)(opts)) {
59
- method = 'jwk';
60
- if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
61
- return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`));
62
- }
63
- key = yield context.agent.keyManagerGet({ kid: (_d = opts.kmsKeyRef) !== null && _d !== void 0 ? _d : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk: opts.identifier }) });
151
+ resolutionResult = yield getManagedJwkIdentifier(opts, context);
64
152
  }
65
153
  else if ((0, types_1.isManagedIdentifierX5cOpts)(opts)) {
66
- method = 'x5c';
67
- x5c = opts.identifier;
68
- if (x5c.length === 0) {
69
- return Promise.reject(`Cannot resolve x5c when an empty x5c is passed in`);
70
- }
71
- else if (!(0, ssi_sdk_agent_config_1.contextHasKeyManager)(context)) {
72
- return Promise.reject(Error(`Cannot get X5c identifier if KeyManager plugin is not enabled!`));
73
- }
74
- certificate = (0, ssi_sdk_ext_x509_utils_1.pemOrDerToX509Certificate)(x5c[0]);
75
- const cryptoEngine = new pkijs_1.CryptoEngine({ name: 'identifier_resolver_managed', crypto: cryptoImpl });
76
- (0, pkijs_1.setEngine)(cryptoEngine.name, cryptoEngine);
77
- const pk = yield certificate.getPublicKey(undefined, cryptoEngine);
78
- jwk = (yield cryptoEngine.subtle.exportKey('jwk', pk));
79
- jwkThumbprint = (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
80
- key = yield context.agent.keyManagerGet({ kid: (_e = opts.kmsKeyRef) !== null && _e !== void 0 ? _e : jwkThumbprint });
154
+ resolutionResult = yield getManagedX5cIdentifier(opts, context);
81
155
  }
82
156
  else {
83
157
  return Promise.reject(Error(`Could not determine identifier method. Please provide explicitly`));
84
158
  }
85
- if (!key || ((0, types_1.isManagedIdentifierDidOpts)(opts) && !identifier)) {
159
+ const { key } = resolutionResult;
160
+ if (!key || ((0, types_1.isManagedIdentifierDidOpts)(opts) && (0, types_1.isManagedIdentifierDidResult)(resolutionResult) && !resolutionResult.identifier)) {
86
161
  console.log(`Cannot find identifier`, opts.identifier);
87
162
  return Promise.reject(`Cannot find identifier ${opts.identifier}`);
88
163
  }
89
- jwk = jwk !== null && jwk !== void 0 ? jwk : (0, ssi_sdk_ext_key_utils_1.toJwk)(key.publicKeyHex, key.type, { key });
90
- const thumbprint = (_g = jwkThumbprint !== null && jwkThumbprint !== void 0 ? jwkThumbprint : (_f = key.meta) === null || _f === void 0 ? void 0 : _f.jwkThumbprint) !== null && _g !== void 0 ? _g : (0, ssi_sdk_ext_key_utils_1.calculateJwkThumbprint)({ jwk });
91
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ method,
92
- jwk, jwkThumbprint: thumbprint }, (identifier && { identifier })), (did && { did })), (controllerKeyId && { controllerKeyId })), (keys && { keys })), (certificate && { certificate: certificate.toJSON() })), { key, kmsKeyRef: key.kid });
164
+ return resolutionResult;
93
165
  });
94
166
  }
95
167
  exports.getManagedIdentifier = getManagedIdentifier;
@@ -1 +1 @@
1
- {"version":3,"file":"managedIdentifierFunctions.js","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2EAAyE;AACzE,2EAAoF;AACpF,6EAA4E;AAC5E,yEAA2F;AAE3F,iCAA4D;AAC5D,oCAOiB;AAEjB,SAAsB,oBAAoB,CACxC,IAEC,EACD,OAAmC;;;QAEnC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;QACrB,IAAI,UAAU,GAA4B,SAAS,CAAA;QACnD,IAAI,IAAI,GAAuB,SAAS,CAAA;QACxC,IAAI,GAAG,GAAqB,SAAS,CAAA;QACrC,IAAI,WAAW,GAA4B,SAAS,CAAA;QACpD,IAAI,GAAG,GAAoB,SAAS,CAAA;QACpC,IAAI,aAAa,GAAuB,SAAS,CAAA;QACjD,IAAI,GAAyB,CAAA;QAC7B,IAAI,eAAe,GAAuB,SAAS,CAAA;QACnD,IAAI,GAAG,GAAuB,SAAS,CAAA;QACvC,MAAM,UAAU,GAAG,MAAA,IAAI,CAAC,MAAM,mCAAI,MAAM,CAAA;QACxC,IAAI,IAAA,kCAA0B,EAAC,IAAI,CAAC,EAAE,CAAC;YACrC,MAAM,GAAG,KAAK,CAAA;YACd,IAAI,CAAC,IAAA,2CAAoB,EAAC,OAAO,CAAC,EAAE,CAAC;gBACnC,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC,CAAA;YACpG,CAAC;YACD,GAAG,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,MAAA,IAAI,CAAC,SAAS,mCAAI,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;QACrF,CAAC;aAAM,IAAI,IAAA,kCAA0B,EAAC,IAAI,CAAC,EAAE,C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
  identifier: ManagedIdentifierType;
14
14
  kmsKeyRef?: string;
15
+ issuer?: string;
16
+ kid?: string;
15
17
  };
16
18
  export type ManagedIdentifierDidOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
17
19
  method?: 'did';
@@ -44,6 +46,8 @@ export interface ManagedJwkInfo extends JwkInfo {
44
46
  export interface IManagedIdentifierResultBase extends ManagedJwkInfo {
45
47
  method: ManagedIdentifierMethod;
46
48
  key: IKey;
49
+ kid?: string;
50
+ issuer?: string;
47
51
  }
48
52
  export declare function isManagedIdentifierDidResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierDidResult;
49
53
  export declare function isManagedIdentifierX5cResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierDidResult;
@@ -55,13 +59,17 @@ export interface ManagedIdentifierDidResult extends IManagedIdentifierResultBase
55
59
  did: string;
56
60
  keys: Array<IKey>;
57
61
  verificationMethodSection?: DIDDocumentSection;
58
- controllerKeyId: string;
62
+ controllerKeyId?: string;
63
+ issuer: string;
64
+ kid: string;
59
65
  }
60
66
  export interface ManagedIdentifierJwkResult extends IManagedIdentifierResultBase {
61
67
  method: 'jwk';
62
68
  }
63
69
  export interface ManagedIdentifierKidResult extends IManagedIdentifierResultBase {
64
70
  method: 'kid';
71
+ issuer: string;
72
+ kid: string;
65
73
  }
66
74
  export interface ManagedIdentifierX5cResult extends IManagedIdentifierResultBase {
67
75
  method: 'x5c';
@@ -69,5 +77,5 @@ export interface ManagedIdentifierX5cResult extends IManagedIdentifierResultBase
69
77
  certificate: any;
70
78
  }
71
79
  export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid';
72
- export type ManagedIdentifierResult = ManagedIdentifierX5cResult | ManagedIdentifierDidResult | ManagedIdentifierJwkResult | ManagedIdentifierKidResult;
80
+ export type ManagedIdentifierResult = IManagedIdentifierResultBase & (ManagedIdentifierX5cResult | ManagedIdentifierDidResult | ManagedIdentifierJwkResult | ManagedIdentifierKidResult);
73
81
  //# sourceMappingURL=managedIdentifierTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"managedIdentifierTypes.d.ts","sourceRoot":"","sources":["../../src/types/managedIdentifierTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAsE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEtG;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAW,MAAM,GAAkB,MAAM,EAAE,GAAW,GAAG,CAAA;AAExG,MAAM,MAAM,qBAAqB,GAAG,CAAC,wBAAwB,GAAG,wBAAwB,GAAG,wBAAwB,GAAG,wBAAwB,CAAC,GAC7I,yBAAyB,CAAA;AAE3B,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,UAAU,EAAE,qBAAqB,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,GAAG;IACjF,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,UAAU,EAAE,WAAW,GAAG,MAAM,CAAA;IAChC,OAAO,CAAC,EAAE,QAAQ,CAAA;IAClB,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,4BAA4B,CAAC,EAAE,OAAO,CAAA;IACtC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,cAAc,CAAC,EAAE,kBAAkB,CAAA;CACpC,CAAA;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,IAAI,IAAI,wBAAwB,CAG5G;AAED,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,yBAAyB,EAAE,QAAQ,CAAC,GAAG;IACjF,MAAM,CAAC,EAAE,KAA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AAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAA;AAChG,CAAC;AAFD,oEAEC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk-ext.identifier-resolution",
3
- "version": "0.24.1-unstable.76+7aab610",
3
+ "version": "0.24.1-unstable.77+c17edaf",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,9 +15,9 @@
15
15
  "generate-plugin-schema": "sphereon dev generate-plugin-schema"
16
16
  },
17
17
  "dependencies": {
18
- "@sphereon/ssi-sdk-ext.did-utils": "0.24.1-unstable.76+7aab610",
19
- "@sphereon/ssi-sdk-ext.key-utils": "0.24.1-unstable.76+7aab610",
20
- "@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-unstable.76+7aab610",
18
+ "@sphereon/ssi-sdk-ext.did-utils": "0.24.1-unstable.77+c17edaf",
19
+ "@sphereon/ssi-sdk-ext.key-utils": "0.24.1-unstable.77+c17edaf",
20
+ "@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-unstable.77+c17edaf",
21
21
  "@sphereon/ssi-sdk.agent-config": "0.29.1-unstable.75",
22
22
  "@sphereon/ssi-types": "0.29.1-unstable.75",
23
23
  "@veramo/core": "4.2.0",
@@ -27,10 +27,10 @@
27
27
  "uint8arrays": "^3.1.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.24.1-unstable.76+7aab610",
31
- "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-unstable.76+7aab610",
32
- "@sphereon/ssi-sdk-ext.key-manager": "0.24.1-unstable.76+7aab610",
33
- "@sphereon/ssi-sdk-ext.kms-local": "0.24.1-unstable.76+7aab610",
30
+ "@sphereon/ssi-sdk-ext.did-provider-jwk": "0.24.1-unstable.77+c17edaf",
31
+ "@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-unstable.77+c17edaf",
32
+ "@sphereon/ssi-sdk-ext.key-manager": "0.24.1-unstable.77+c17edaf",
33
+ "@sphereon/ssi-sdk-ext.kms-local": "0.24.1-unstable.77+c17edaf",
34
34
  "@sphereon/ssi-sdk.dev": "0.29.1-unstable.75",
35
35
  "@veramo/data-store": "4.2.0",
36
36
  "@veramo/did-manager": "4.2.0",
@@ -64,5 +64,5 @@
64
64
  "X.509 Certificates",
65
65
  "ARF"
66
66
  ],
67
- "gitHead": "7aab610fc75278f746743e1a44988e9bef279639"
67
+ "gitHead": "c17edaf8f7fa14a0a998d7ea5b5370e5014dbc0b"
68
68
  }
@@ -973,6 +973,12 @@
973
973
  },
974
974
  "kmsKeyRef": {
975
975
  "type": "string"
976
+ },
977
+ "issuer": {
978
+ "type": "string"
979
+ },
980
+ "kid": {
981
+ "type": "string"
976
982
  }
977
983
  },
978
984
  "required": [
@@ -991,6 +997,12 @@
991
997
  },
992
998
  "kmsKeyRef": {
993
999
  "type": "string"
1000
+ },
1001
+ "issuer": {
1002
+ "type": "string"
1003
+ },
1004
+ "kid": {
1005
+ "type": "string"
994
1006
  }
995
1007
  },
996
1008
  "required": [
@@ -1010,6 +1022,12 @@
1010
1022
  "kmsKeyRef": {
1011
1023
  "type": "string"
1012
1024
  },
1025
+ "issuer": {
1026
+ "type": "string"
1027
+ },
1028
+ "kid": {
1029
+ "type": "string"
1030
+ },
1013
1031
  "keyType": {
1014
1032
  "$ref": "#/components/schemas/TKeyType"
1015
1033
  },
@@ -1042,6 +1060,12 @@
1042
1060
  },
1043
1061
  "kmsKeyRef": {
1044
1062
  "type": "string"
1063
+ },
1064
+ "issuer": {
1065
+ "type": "string"
1066
+ },
1067
+ "kid": {
1068
+ "type": "string"
1045
1069
  }
1046
1070
  },
1047
1071
  "required": [
@@ -1231,54 +1255,219 @@
1231
1255
  "ManagedIdentifierResult": {
1232
1256
  "anyOf": [
1233
1257
  {
1234
- "$ref": "#/components/schemas/ManagedIdentifierX5cResult"
1258
+ "type": "object",
1259
+ "properties": {
1260
+ "jwk": {
1261
+ "$ref": "#/components/schemas/JWK"
1262
+ },
1263
+ "jwkThumbprint": {
1264
+ "type": "string"
1265
+ },
1266
+ "kmsKeyRef": {
1267
+ "type": "string"
1268
+ },
1269
+ "method": {
1270
+ "$ref": "#/components/schemas/ManagedIdentifierMethod"
1271
+ },
1272
+ "key": {
1273
+ "$ref": "#/components/schemas/IKey"
1274
+ },
1275
+ "kid": {
1276
+ "type": "string"
1277
+ },
1278
+ "issuer": {
1279
+ "type": "string"
1280
+ },
1281
+ "x5c": {
1282
+ "type": "array",
1283
+ "items": {
1284
+ "type": "string"
1285
+ }
1286
+ },
1287
+ "certificate": {}
1288
+ },
1289
+ "required": [
1290
+ "certificate",
1291
+ "jwk",
1292
+ "jwkThumbprint",
1293
+ "key",
1294
+ "kmsKeyRef",
1295
+ "method",
1296
+ "x5c"
1297
+ ]
1235
1298
  },
1236
1299
  {
1237
- "$ref": "#/components/schemas/ManagedIdentifierDidResult"
1300
+ "type": "object",
1301
+ "properties": {
1302
+ "jwk": {
1303
+ "$ref": "#/components/schemas/JWK"
1304
+ },
1305
+ "jwkThumbprint": {
1306
+ "type": "string"
1307
+ },
1308
+ "kmsKeyRef": {
1309
+ "type": "string"
1310
+ },
1311
+ "method": {
1312
+ "$ref": "#/components/schemas/ManagedIdentifierMethod"
1313
+ },
1314
+ "key": {
1315
+ "$ref": "#/components/schemas/IKey"
1316
+ },
1317
+ "kid": {
1318
+ "type": "string"
1319
+ },
1320
+ "issuer": {
1321
+ "type": "string"
1322
+ },
1323
+ "identifier": {
1324
+ "$ref": "#/components/schemas/IIdentifier"
1325
+ },
1326
+ "did": {
1327
+ "type": "string"
1328
+ },
1329
+ "keys": {
1330
+ "type": "array",
1331
+ "items": {
1332
+ "$ref": "#/components/schemas/IKey"
1333
+ }
1334
+ },
1335
+ "verificationMethodSection": {
1336
+ "$ref": "#/components/schemas/DIDDocumentSection"
1337
+ },
1338
+ "controllerKeyId": {
1339
+ "type": "string"
1340
+ }
1341
+ },
1342
+ "required": [
1343
+ "did",
1344
+ "identifier",
1345
+ "issuer",
1346
+ "jwk",
1347
+ "jwkThumbprint",
1348
+ "key",
1349
+ "keys",
1350
+ "kid",
1351
+ "kmsKeyRef",
1352
+ "method"
1353
+ ]
1238
1354
  },
1239
1355
  {
1240
- "$ref": "#/components/schemas/ManagedIdentifierJwkResult"
1356
+ "type": "object",
1357
+ "properties": {
1358
+ "jwk": {
1359
+ "$ref": "#/components/schemas/JWK"
1360
+ },
1361
+ "jwkThumbprint": {
1362
+ "type": "string"
1363
+ },
1364
+ "kmsKeyRef": {
1365
+ "type": "string"
1366
+ },
1367
+ "method": {
1368
+ "$ref": "#/components/schemas/ManagedIdentifierMethod"
1369
+ },
1370
+ "key": {
1371
+ "$ref": "#/components/schemas/IKey"
1372
+ },
1373
+ "kid": {
1374
+ "type": "string"
1375
+ },
1376
+ "issuer": {
1377
+ "type": "string"
1378
+ }
1379
+ },
1380
+ "required": [
1381
+ "jwk",
1382
+ "jwkThumbprint",
1383
+ "key",
1384
+ "kmsKeyRef",
1385
+ "method"
1386
+ ]
1241
1387
  },
1242
1388
  {
1243
- "$ref": "#/components/schemas/ManagedIdentifierKidResult"
1389
+ "type": "object",
1390
+ "properties": {
1391
+ "jwk": {
1392
+ "$ref": "#/components/schemas/JWK"
1393
+ },
1394
+ "jwkThumbprint": {
1395
+ "type": "string"
1396
+ },
1397
+ "kmsKeyRef": {
1398
+ "type": "string"
1399
+ },
1400
+ "method": {
1401
+ "$ref": "#/components/schemas/ManagedIdentifierMethod"
1402
+ },
1403
+ "key": {
1404
+ "$ref": "#/components/schemas/IKey"
1405
+ },
1406
+ "kid": {
1407
+ "type": "string"
1408
+ },
1409
+ "issuer": {
1410
+ "type": "string"
1411
+ }
1412
+ },
1413
+ "required": [
1414
+ "issuer",
1415
+ "jwk",
1416
+ "jwkThumbprint",
1417
+ "key",
1418
+ "kid",
1419
+ "kmsKeyRef",
1420
+ "method"
1421
+ ]
1244
1422
  }
1245
1423
  ]
1246
1424
  },
1247
- "ManagedIdentifierX5cResult": {
1425
+ "ManagedIdentifierMethod": {
1426
+ "type": "string",
1427
+ "enum": [
1428
+ "did",
1429
+ "jwk",
1430
+ "x5c",
1431
+ "kid"
1432
+ ]
1433
+ },
1434
+ "ManagedIdentifierDidOpts": {
1248
1435
  "type": "object",
1249
1436
  "properties": {
1250
- "jwk": {
1251
- "$ref": "#/components/schemas/JWK"
1437
+ "method": {
1438
+ "type": "string",
1439
+ "const": "did"
1252
1440
  },
1253
- "jwkThumbprint": {
1254
- "type": "string"
1441
+ "identifier": {
1442
+ "$ref": "#/components/schemas/ManagedIdentifierType"
1255
1443
  },
1256
- "kmsKeyRef": {
1257
- "type": "string"
1444
+ "keyType": {
1445
+ "$ref": "#/components/schemas/TKeyType"
1258
1446
  },
1259
- "method": {
1260
- "type": "string",
1261
- "const": "x5c"
1447
+ "offlineWhenNoDIDRegistered": {
1448
+ "type": "boolean"
1262
1449
  },
1263
- "key": {
1264
- "$ref": "#/components/schemas/IKey"
1450
+ "noVerificationMethodFallback": {
1451
+ "type": "boolean"
1265
1452
  },
1266
- "x5c": {
1267
- "type": "array",
1268
- "items": {
1269
- "type": "string"
1270
- }
1453
+ "controllerKey": {
1454
+ "type": "boolean"
1271
1455
  },
1272
- "certificate": {}
1456
+ "vmRelationship": {
1457
+ "$ref": "#/components/schemas/DIDDocumentSection"
1458
+ },
1459
+ "kmsKeyRef": {
1460
+ "type": "string"
1461
+ },
1462
+ "issuer": {
1463
+ "type": "string"
1464
+ },
1465
+ "kid": {
1466
+ "type": "string"
1467
+ }
1273
1468
  },
1274
1469
  "required": [
1275
- "certificate",
1276
- "jwk",
1277
- "jwkThumbprint",
1278
- "key",
1279
- "kmsKeyRef",
1280
- "method",
1281
- "x5c"
1470
+ "identifier"
1282
1471
  ]
1283
1472
  },
1284
1473
  "ManagedIdentifierDidResult": {
@@ -1300,6 +1489,12 @@
1300
1489
  "key": {
1301
1490
  "$ref": "#/components/schemas/IKey"
1302
1491
  },
1492
+ "kid": {
1493
+ "type": "string"
1494
+ },
1495
+ "issuer": {
1496
+ "type": "string"
1497
+ },
1303
1498
  "identifier": {
1304
1499
  "$ref": "#/components/schemas/IIdentifier"
1305
1500
  },
@@ -1320,46 +1515,43 @@
1320
1515
  }
1321
1516
  },
1322
1517
  "required": [
1323
- "controllerKeyId",
1324
1518
  "did",
1325
1519
  "identifier",
1520
+ "issuer",
1326
1521
  "jwk",
1327
1522
  "jwkThumbprint",
1328
1523
  "key",
1329
1524
  "keys",
1525
+ "kid",
1330
1526
  "kmsKeyRef",
1331
1527
  "method"
1332
1528
  ]
1333
1529
  },
1334
- "ManagedIdentifierJwkResult": {
1530
+ "ManagedIdentifierJwkOpts": {
1335
1531
  "type": "object",
1336
1532
  "properties": {
1337
- "jwk": {
1338
- "$ref": "#/components/schemas/JWK"
1533
+ "method": {
1534
+ "type": "string",
1535
+ "const": "jwk"
1339
1536
  },
1340
- "jwkThumbprint": {
1341
- "type": "string"
1537
+ "identifier": {
1538
+ "$ref": "#/components/schemas/ManagedIdentifierType"
1342
1539
  },
1343
1540
  "kmsKeyRef": {
1344
1541
  "type": "string"
1345
1542
  },
1346
- "method": {
1347
- "type": "string",
1348
- "const": "jwk"
1543
+ "issuer": {
1544
+ "type": "string"
1349
1545
  },
1350
- "key": {
1351
- "$ref": "#/components/schemas/IKey"
1546
+ "kid": {
1547
+ "type": "string"
1352
1548
  }
1353
1549
  },
1354
1550
  "required": [
1355
- "jwk",
1356
- "jwkThumbprint",
1357
- "key",
1358
- "kmsKeyRef",
1359
- "method"
1551
+ "identifier"
1360
1552
  ]
1361
1553
  },
1362
- "ManagedIdentifierKidResult": {
1554
+ "ManagedIdentifierJwkResult": {
1363
1555
  "type": "object",
1364
1556
  "properties": {
1365
1557
  "jwk": {
@@ -1373,10 +1565,16 @@
1373
1565
  },
1374
1566
  "method": {
1375
1567
  "type": "string",
1376
- "const": "kid"
1568
+ "const": "jwk"
1377
1569
  },
1378
1570
  "key": {
1379
1571
  "$ref": "#/components/schemas/IKey"
1572
+ },
1573
+ "kid": {
1574
+ "type": "string"
1575
+ },
1576
+ "issuer": {
1577
+ "type": "string"
1380
1578
  }
1381
1579
  },
1382
1580
  "required": [
@@ -1387,32 +1585,23 @@
1387
1585
  "method"
1388
1586
  ]
1389
1587
  },
1390
- "ManagedIdentifierDidOpts": {
1588
+ "ManagedIdentifierKidOpts": {
1391
1589
  "type": "object",
1392
1590
  "properties": {
1393
1591
  "method": {
1394
1592
  "type": "string",
1395
- "const": "did"
1593
+ "const": "kid"
1396
1594
  },
1397
1595
  "identifier": {
1398
1596
  "$ref": "#/components/schemas/ManagedIdentifierType"
1399
1597
  },
1400
- "keyType": {
1401
- "$ref": "#/components/schemas/TKeyType"
1402
- },
1403
- "offlineWhenNoDIDRegistered": {
1404
- "type": "boolean"
1405
- },
1406
- "noVerificationMethodFallback": {
1407
- "type": "boolean"
1408
- },
1409
- "controllerKey": {
1410
- "type": "boolean"
1598
+ "kmsKeyRef": {
1599
+ "type": "string"
1411
1600
  },
1412
- "vmRelationship": {
1413
- "$ref": "#/components/schemas/DIDDocumentSection"
1601
+ "issuer": {
1602
+ "type": "string"
1414
1603
  },
1415
- "kmsKeyRef": {
1604
+ "kid": {
1416
1605
  "type": "string"
1417
1606
  }
1418
1607
  },
@@ -1420,58 +1609,107 @@
1420
1609
  "identifier"
1421
1610
  ]
1422
1611
  },
1423
- "ManagedIdentifierJwkOpts": {
1612
+ "ManagedIdentifierKidResult": {
1424
1613
  "type": "object",
1425
1614
  "properties": {
1615
+ "jwk": {
1616
+ "$ref": "#/components/schemas/JWK"
1617
+ },
1618
+ "jwkThumbprint": {
1619
+ "type": "string"
1620
+ },
1621
+ "kmsKeyRef": {
1622
+ "type": "string"
1623
+ },
1426
1624
  "method": {
1427
1625
  "type": "string",
1428
- "const": "jwk"
1626
+ "const": "kid"
1429
1627
  },
1430
- "identifier": {
1431
- "$ref": "#/components/schemas/ManagedIdentifierType"
1628
+ "key": {
1629
+ "$ref": "#/components/schemas/IKey"
1432
1630
  },
1433
- "kmsKeyRef": {
1631
+ "kid": {
1632
+ "type": "string"
1633
+ },
1634
+ "issuer": {
1434
1635
  "type": "string"
1435
1636
  }
1436
1637
  },
1437
1638
  "required": [
1438
- "identifier"
1639
+ "issuer",
1640
+ "jwk",
1641
+ "jwkThumbprint",
1642
+ "key",
1643
+ "kid",
1644
+ "kmsKeyRef",
1645
+ "method"
1439
1646
  ]
1440
1647
  },
1441
- "ManagedIdentifierKidOpts": {
1648
+ "ManagedIdentifierX5cOpts": {
1442
1649
  "type": "object",
1443
1650
  "properties": {
1444
1651
  "method": {
1445
1652
  "type": "string",
1446
- "const": "kid"
1653
+ "const": "x5c"
1447
1654
  },
1448
1655
  "identifier": {
1449
1656
  "$ref": "#/components/schemas/ManagedIdentifierType"
1450
1657
  },
1451
1658
  "kmsKeyRef": {
1452
1659
  "type": "string"
1660
+ },
1661
+ "issuer": {
1662
+ "type": "string"
1663
+ },
1664
+ "kid": {
1665
+ "type": "string"
1453
1666
  }
1454
1667
  },
1455
1668
  "required": [
1456
1669
  "identifier"
1457
1670
  ]
1458
1671
  },
1459
- "ManagedIdentifierX5cOpts": {
1672
+ "ManagedIdentifierX5cResult": {
1460
1673
  "type": "object",
1461
1674
  "properties": {
1675
+ "jwk": {
1676
+ "$ref": "#/components/schemas/JWK"
1677
+ },
1678
+ "jwkThumbprint": {
1679
+ "type": "string"
1680
+ },
1681
+ "kmsKeyRef": {
1682
+ "type": "string"
1683
+ },
1462
1684
  "method": {
1463
1685
  "type": "string",
1464
1686
  "const": "x5c"
1465
1687
  },
1466
- "identifier": {
1467
- "$ref": "#/components/schemas/ManagedIdentifierType"
1688
+ "key": {
1689
+ "$ref": "#/components/schemas/IKey"
1468
1690
  },
1469
- "kmsKeyRef": {
1691
+ "kid": {
1470
1692
  "type": "string"
1471
- }
1693
+ },
1694
+ "issuer": {
1695
+ "type": "string"
1696
+ },
1697
+ "x5c": {
1698
+ "type": "array",
1699
+ "items": {
1700
+ "type": "string"
1701
+ }
1702
+ },
1703
+ "certificate": {}
1472
1704
  },
1473
1705
  "required": [
1474
- "identifier"
1706
+ "certificate",
1707
+ "jwk",
1708
+ "jwkThumbprint",
1709
+ "key",
1710
+ "kmsKeyRef",
1711
+ "method",
1712
+ "x5c"
1475
1713
  ]
1476
1714
  }
1477
1715
  },
@@ -2,104 +2,177 @@ import { getFirstKeyWithRelation } from '@sphereon/ssi-sdk-ext.did-utils'
2
2
  import { calculateJwkThumbprint, JWK, toJwk } from '@sphereon/ssi-sdk-ext.key-utils'
3
3
  import { pemOrDerToX509Certificate } from '@sphereon/ssi-sdk-ext.x509-utils'
4
4
  import { contextHasDidManager, contextHasKeyManager } from '@sphereon/ssi-sdk.agent-config'
5
- import { IAgentContext, IIdentifier, IKey, IKeyManager } from '@veramo/core'
6
- import { Certificate, CryptoEngine, setEngine } from 'pkijs'
5
+ import { IAgentContext, IIdentifier, IKeyManager } from '@veramo/core'
6
+ import { CryptoEngine, setEngine } from 'pkijs'
7
7
  import {
8
8
  isManagedIdentifierDidOpts,
9
+ isManagedIdentifierDidResult,
9
10
  isManagedIdentifierJwkOpts,
10
11
  isManagedIdentifierKidOpts,
11
12
  isManagedIdentifierX5cOpts,
13
+ ManagedIdentifierDidOpts,
14
+ ManagedIdentifierDidResult,
15
+ ManagedIdentifierJwkOpts,
16
+ ManagedIdentifierJwkResult,
17
+ ManagedIdentifierKidOpts,
18
+ ManagedIdentifierKidResult,
12
19
  ManagedIdentifierOpts,
13
20
  ManagedIdentifierResult,
21
+ ManagedIdentifierX5cOpts,
22
+ ManagedIdentifierX5cResult,
14
23
  } from '../types'
15
24
 
25
+ export async function getManagedKidIdentifier(
26
+ opts: ManagedIdentifierKidOpts,
27
+ context: IAgentContext<IKeyManager>
28
+ ): Promise<ManagedIdentifierKidResult> {
29
+ const method = 'kid'
30
+ if (!contextHasKeyManager(context)) {
31
+ return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
32
+ }
33
+ const key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? opts.identifier })
34
+ const jwk = toJwk(key.publicKeyHex, key.type, { key })
35
+ const jwkThumbprint = (key.meta?.jwkThumbprint as string) ?? calculateJwkThumbprint({ jwk })
36
+ const kid = opts.kid ?? (key.meta?.verificationMethod?.id as string) ?? jwkThumbprint
37
+ const issuer = opts.issuer ?? kid // The different identifiers should set the value. Defaults to the kid
38
+ return {
39
+ method,
40
+ key,
41
+ jwk,
42
+ jwkThumbprint,
43
+ kid,
44
+ issuer,
45
+ kmsKeyRef: key.kid,
46
+ } satisfies ManagedIdentifierKidResult
47
+ }
48
+
49
+ export async function getManagedDidIdentifier(opts: ManagedIdentifierDidOpts, context: IAgentContext<any>): Promise<ManagedIdentifierDidResult> {
50
+ const method = 'did'
51
+ if (!contextHasDidManager(context)) {
52
+ return Promise.reject(Error(`Cannot get DID identifier if DID Manager plugin is not enabled!`))
53
+ }
54
+
55
+ let identifier: IIdentifier
56
+ if (typeof opts.identifier === 'string') {
57
+ identifier = await context.agent.didManagerGet({ did: opts.identifier.split('#')[0] })
58
+ } else {
59
+ identifier = opts.identifier
60
+ }
61
+
62
+ const did = identifier.did
63
+ const keys = identifier?.keys // fixme: We really want to return the vmRelationship keys here actually
64
+ const extendedKey = await getFirstKeyWithRelation(
65
+ {
66
+ ...opts,
67
+ identifier,
68
+ vmRelationship: opts.vmRelationship ?? 'verificationMethod',
69
+ },
70
+ context
71
+ )
72
+ const key = extendedKey
73
+ const controllerKeyId = identifier.controllerKeyId
74
+ const jwk = toJwk(key.publicKeyHex, key.type, { key })
75
+ const jwkThumbprint = key.meta?.jwkThumbprint ?? calculateJwkThumbprint({ jwk })
76
+ const kid = opts.kid ?? extendedKey.meta?.verificationMethod?.id
77
+ const issuer = opts.issuer ?? did
78
+ return {
79
+ method,
80
+ key,
81
+ did,
82
+ kmsKeyRef: key.kid,
83
+ jwk,
84
+ jwkThumbprint,
85
+ controllerKeyId,
86
+ kid,
87
+ keys,
88
+ issuer,
89
+ identifier,
90
+ }
91
+ }
92
+
93
+ export async function getManagedJwkIdentifier(
94
+ opts: ManagedIdentifierJwkOpts,
95
+ context: IAgentContext<IKeyManager>
96
+ ): Promise<ManagedIdentifierJwkResult> {
97
+ const method = 'jwk'
98
+ const { kid, issuer } = opts
99
+ if (!contextHasKeyManager(context)) {
100
+ return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
101
+ }
102
+ const key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? calculateJwkThumbprint({ jwk: opts.identifier }) })
103
+ const jwk = opts.identifier ?? toJwk(key.publicKeyHex, key.type, { key })
104
+ const jwkThumbprint = (key.meta?.jwkThumbprint as string) ?? calculateJwkThumbprint({ jwk })
105
+ // we explicitly do not set the kid and issuer, meaning it can remain null. Normally you do not provide a kid and issuer with Jwks.
106
+ return {
107
+ method,
108
+ key,
109
+ kmsKeyRef: key.kid,
110
+ jwk,
111
+ jwkThumbprint,
112
+ kid,
113
+ issuer,
114
+ } satisfies ManagedIdentifierJwkResult
115
+ }
116
+
117
+ export async function getManagedX5cIdentifier(
118
+ opts: ManagedIdentifierX5cOpts & {
119
+ crypto?: Crypto
120
+ },
121
+ context: IAgentContext<IKeyManager>
122
+ ): Promise<ManagedIdentifierX5cResult> {
123
+ const { kid, issuer } = opts
124
+ const method = 'x5c'
125
+ const x5c = opts.identifier
126
+ if (x5c.length === 0) {
127
+ return Promise.reject(`Cannot resolve x5c when an empty x5c is passed in`)
128
+ } else if (!contextHasKeyManager(context)) {
129
+ return Promise.reject(Error(`Cannot get X5c identifier if KeyManager plugin is not enabled!`))
130
+ }
131
+ const cryptoImpl = opts.crypto ?? crypto
132
+ const certificate = pemOrDerToX509Certificate(x5c[0])
133
+ const cryptoEngine = new CryptoEngine({ name: 'identifier_resolver_managed', crypto: cryptoImpl })
134
+ setEngine(cryptoEngine.name, cryptoEngine)
135
+ const pk = await certificate.getPublicKey(undefined, cryptoEngine)
136
+ const jwk = (await cryptoEngine.subtle.exportKey('jwk', pk)) as JWK
137
+ const jwkThumbprint = calculateJwkThumbprint({ jwk })
138
+ const key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? jwkThumbprint })
139
+ // we explicitly do not set the kid and issuer, meaning it can remain null. Normally you do not provide a kid and issuer with x5c.
140
+
141
+ return {
142
+ method,
143
+ x5c,
144
+ certificate,
145
+ jwk,
146
+ jwkThumbprint,
147
+ key,
148
+ kmsKeyRef: key.kid,
149
+ kid,
150
+ issuer,
151
+ } satisfies ManagedIdentifierX5cResult
152
+ }
153
+
16
154
  export async function getManagedIdentifier(
17
155
  opts: ManagedIdentifierOpts & {
18
156
  crypto?: Crypto
19
157
  },
20
158
  context: IAgentContext<IKeyManager>
21
159
  ): Promise<ManagedIdentifierResult> {
22
- let { method } = opts
23
- let identifier: IIdentifier | undefined = undefined
24
- let keys: IKey[] | undefined = undefined
25
- let key: IKey | undefined = undefined
26
- let certificate: Certificate | undefined = undefined
27
- let jwk: JWK | undefined = undefined
28
- let jwkThumbprint: string | undefined = undefined
29
- let x5c: string[] | undefined
30
- let controllerKeyId: string | undefined = undefined
31
- let did: string | undefined = undefined
32
- const cryptoImpl = opts.crypto ?? crypto
160
+ let resolutionResult: ManagedIdentifierResult
33
161
  if (isManagedIdentifierKidOpts(opts)) {
34
- method = 'kid'
35
- if (!contextHasKeyManager(context)) {
36
- return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
37
- }
38
- key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? opts.identifier })
162
+ resolutionResult = await getManagedKidIdentifier(opts, context)
39
163
  } else if (isManagedIdentifierDidOpts(opts)) {
40
- method = 'did'
41
- if (!contextHasDidManager(context)) {
42
- return Promise.reject(Error(`Cannot get DID identifier if DID Manager plugin is not enabled!`))
43
- }
44
-
45
- if (typeof opts.identifier === 'string') {
46
- identifier = await context.agent.didManagerGet({ did: opts.identifier.split('#')[0] })
47
- } else {
48
- identifier = opts.identifier
49
- }
50
- if (identifier) {
51
- did = identifier.did
52
- keys = identifier?.keys // fixme: We really want to return the vmRelationship keys here actually
53
- key = await getFirstKeyWithRelation(
54
- {
55
- ...opts,
56
- identifier,
57
- vmRelationship: opts.vmRelationship ?? 'verificationMethod',
58
- },
59
- context
60
- )
61
- controllerKeyId = identifier.controllerKeyId
62
- }
164
+ resolutionResult = await getManagedDidIdentifier(opts, context)
63
165
  } else if (isManagedIdentifierJwkOpts(opts)) {
64
- method = 'jwk'
65
- if (!contextHasKeyManager(context)) {
66
- return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
67
- }
68
- key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? calculateJwkThumbprint({ jwk: opts.identifier }) })
166
+ resolutionResult = await getManagedJwkIdentifier(opts, context)
69
167
  } else if (isManagedIdentifierX5cOpts(opts)) {
70
- method = 'x5c'
71
- x5c = opts.identifier
72
- if (x5c.length === 0) {
73
- return Promise.reject(`Cannot resolve x5c when an empty x5c is passed in`)
74
- } else if (!contextHasKeyManager(context)) {
75
- return Promise.reject(Error(`Cannot get X5c identifier if KeyManager plugin is not enabled!`))
76
- }
77
- certificate = pemOrDerToX509Certificate(x5c[0])
78
- const cryptoEngine = new CryptoEngine({ name: 'identifier_resolver_managed', crypto: cryptoImpl })
79
- setEngine(cryptoEngine.name, cryptoEngine)
80
- const pk = await certificate.getPublicKey(undefined, cryptoEngine)
81
- jwk = (await cryptoEngine.subtle.exportKey('jwk', pk)) as JWK
82
- jwkThumbprint = calculateJwkThumbprint({ jwk })
83
- key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? jwkThumbprint })
168
+ resolutionResult = await getManagedX5cIdentifier(opts, context)
84
169
  } else {
85
170
  return Promise.reject(Error(`Could not determine identifier method. Please provide explicitly`))
86
171
  }
87
- if (!key || (isManagedIdentifierDidOpts(opts) && !identifier)) {
172
+ const { key } = resolutionResult
173
+ if (!key || (isManagedIdentifierDidOpts(opts) && isManagedIdentifierDidResult(resolutionResult) && !resolutionResult.identifier)) {
88
174
  console.log(`Cannot find identifier`, opts.identifier)
89
175
  return Promise.reject(`Cannot find identifier ${opts.identifier}`)
90
176
  }
91
- jwk = jwk ?? toJwk(key.publicKeyHex, key.type, { key })
92
- const thumbprint = jwkThumbprint ?? key.meta?.jwkThumbprint ?? calculateJwkThumbprint({ jwk })
93
- return {
94
- method,
95
- jwk,
96
- jwkThumbprint: thumbprint,
97
- ...(identifier && { identifier }),
98
- ...(did && { did }),
99
- ...(controllerKeyId && { controllerKeyId }),
100
- ...(keys && { keys }),
101
- ...(certificate && { certificate: certificate.toJSON() }),
102
- key,
103
- kmsKeyRef: key.kid,
104
- } as ManagedIdentifierResult
177
+ return resolutionResult
105
178
  }
@@ -16,6 +16,8 @@ export type ManagedIdentifierOptsBase = {
16
16
  method?: ManagedIdentifierMethod // If provided always takes precedences otherwise it will be inferred from the identifier
17
17
  identifier: ManagedIdentifierType
18
18
  kmsKeyRef?: string
19
+ 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
20
+ 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
19
21
  }
20
22
 
21
23
  export type ManagedIdentifierDidOpts = Omit<ManagedIdentifierOptsBase, 'method'> & {
@@ -70,6 +72,8 @@ export interface ManagedJwkInfo extends JwkInfo {
70
72
  export interface IManagedIdentifierResultBase extends ManagedJwkInfo {
71
73
  method: ManagedIdentifierMethod
72
74
  key: IKey
75
+ kid?: string
76
+ issuer?: string
73
77
  }
74
78
 
75
79
  export function isManagedIdentifierDidResult(object: IManagedIdentifierResultBase): object is ManagedIdentifierDidResult {
@@ -95,7 +99,9 @@ export interface ManagedIdentifierDidResult extends IManagedIdentifierResultBase
95
99
  // key: IKey // The key associated with the requested did method sections. Controller key in case of no DID method section requested
96
100
  keys: Array<IKey> // If there is more than one key for the VM relationship.
97
101
  verificationMethodSection?: DIDDocumentSection
98
- controllerKeyId: string
102
+ controllerKeyId?: string
103
+ issuer: string
104
+ kid: string
99
105
  }
100
106
 
101
107
  export interface ManagedIdentifierJwkResult extends IManagedIdentifierResultBase {
@@ -104,6 +110,8 @@ export interface ManagedIdentifierJwkResult extends IManagedIdentifierResultBase
104
110
 
105
111
  export interface ManagedIdentifierKidResult extends IManagedIdentifierResultBase {
106
112
  method: 'kid'
113
+ issuer: string
114
+ kid: string
107
115
  }
108
116
 
109
117
  export interface ManagedIdentifierX5cResult extends IManagedIdentifierResultBase {
@@ -114,8 +122,5 @@ export interface ManagedIdentifierX5cResult extends IManagedIdentifierResultBase
114
122
 
115
123
  export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid'
116
124
 
117
- export type ManagedIdentifierResult =
118
- | ManagedIdentifierX5cResult
119
- | ManagedIdentifierDidResult
120
- | ManagedIdentifierJwkResult
121
- | ManagedIdentifierKidResult
125
+ export type ManagedIdentifierResult = IManagedIdentifierResultBase &
126
+ (ManagedIdentifierX5cResult | ManagedIdentifierDidResult | ManagedIdentifierJwkResult | ManagedIdentifierKidResult)