@sphereon/ssi-sdk-ext.identifier-resolution 0.24.1-unstable.88 → 0.24.1-unstable.90
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/functions/managedIdentifierFunctions.d.ts +1 -1
- package/dist/functions/managedIdentifierFunctions.d.ts.map +1 -1
- package/dist/functions/managedIdentifierFunctions.js +14 -2
- package/dist/functions/managedIdentifierFunctions.js.map +1 -1
- package/dist/types/managedIdentifierTypes.d.ts +1 -0
- package/dist/types/managedIdentifierTypes.d.ts.map +1 -1
- package/dist/types/managedIdentifierTypes.js.map +1 -1
- package/package.json +9 -9
- package/plugin.schema.json +48 -8
- package/src/functions/managedIdentifierFunctions.ts +196 -181
- package/src/types/managedIdentifierTypes.ts +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRequiredContext } from
|
|
1
|
+
import { IRequiredContext } from '@sphereon/ssi-sdk-ext.did-provider-jwk';
|
|
2
2
|
import { IAgentContext, IKeyManager } from '@veramo/core';
|
|
3
3
|
import { ManagedIdentifierDidOpts, ManagedIdentifierDidResult, ManagedIdentifierJwkOpts, ManagedIdentifierJwkResult, ManagedIdentifierKeyOpts, ManagedIdentifierKeyResult, ManagedIdentifierKidOpts, ManagedIdentifierKidResult, ManagedIdentifierOpts, ManagedIdentifierOptsOrResult, ManagedIdentifierResult, ManagedIdentifierX5cOpts, ManagedIdentifierX5cResult } from '../types';
|
|
4
4
|
export declare function getManagedKidIdentifier(opts: ManagedIdentifierKidOpts, context: IAgentContext<IKeyManager>): Promise<ManagedIdentifierKidResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedIdentifierFunctions.d.ts","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"managedIdentifierFunctions.d.ts","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"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BAAoB,CACxC,IAAI,EAAE,qBAAqB,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,EACD,OAAO,EAAE,aAAa,CAAC,WAAW,CAAC,GAClC,OAAO,CAAC,uBAAuB,CAAC,CAqBlC"}
|
|
@@ -36,6 +36,7 @@ function getManagedKidIdentifier(opts, context) {
|
|
|
36
36
|
kid,
|
|
37
37
|
issuer,
|
|
38
38
|
kmsKeyRef: key.kid,
|
|
39
|
+
opts,
|
|
39
40
|
};
|
|
40
41
|
});
|
|
41
42
|
}
|
|
@@ -47,7 +48,9 @@ exports.getManagedKidIdentifier = getManagedKidIdentifier;
|
|
|
47
48
|
*/
|
|
48
49
|
function ensureManagedIdentifierResult(identifier, context) {
|
|
49
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
return 'key' in identifier && 'kmsKeyRef' in identifier && 'method' in identifier && !('identifier' in identifier)
|
|
51
|
+
return 'key' in identifier && 'kmsKeyRef' in identifier && 'method' in identifier && !('identifier' in identifier)
|
|
52
|
+
? identifier
|
|
53
|
+
: yield context.agent.identifierManagedGet(identifier);
|
|
51
54
|
});
|
|
52
55
|
}
|
|
53
56
|
exports.ensureManagedIdentifierResult = ensureManagedIdentifierResult;
|
|
@@ -76,6 +79,7 @@ function getManagedKeyIdentifier(opts, _context) {
|
|
|
76
79
|
kid,
|
|
77
80
|
issuer,
|
|
78
81
|
kmsKeyRef: key.kid,
|
|
82
|
+
opts,
|
|
79
83
|
};
|
|
80
84
|
});
|
|
81
85
|
}
|
|
@@ -101,7 +105,12 @@ function getManagedDidIdentifier(opts, context) {
|
|
|
101
105
|
const controllerKeyId = identifier.controllerKeyId;
|
|
102
106
|
const jwk = (0, ssi_sdk_ext_key_utils_1.toJwk)(key.publicKeyHex, key.type, { key });
|
|
103
107
|
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 });
|
|
104
|
-
|
|
108
|
+
let 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;
|
|
109
|
+
if (!kid.startsWith(did)) {
|
|
110
|
+
// Make sure we create a fully qualified kid
|
|
111
|
+
const hash = kid.startsWith('#') ? '' : '#';
|
|
112
|
+
kid = `${did}${hash}${kid}`;
|
|
113
|
+
}
|
|
105
114
|
const issuer = (_g = opts.issuer) !== null && _g !== void 0 ? _g : did;
|
|
106
115
|
return {
|
|
107
116
|
method,
|
|
@@ -115,6 +124,7 @@ function getManagedDidIdentifier(opts, context) {
|
|
|
115
124
|
keys,
|
|
116
125
|
issuer,
|
|
117
126
|
identifier,
|
|
127
|
+
opts,
|
|
118
128
|
};
|
|
119
129
|
});
|
|
120
130
|
}
|
|
@@ -139,6 +149,7 @@ function getManagedJwkIdentifier(opts, context) {
|
|
|
139
149
|
jwkThumbprint,
|
|
140
150
|
kid,
|
|
141
151
|
issuer,
|
|
152
|
+
opts,
|
|
142
153
|
};
|
|
143
154
|
});
|
|
144
155
|
}
|
|
@@ -174,6 +185,7 @@ function getManagedX5cIdentifier(opts, context) {
|
|
|
174
185
|
kmsKeyRef: key.kid,
|
|
175
186
|
kid,
|
|
176
187
|
issuer,
|
|
188
|
+
opts,
|
|
177
189
|
};
|
|
178
190
|
});
|
|
179
191
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedIdentifierFunctions.js","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"managedIdentifierFunctions.js","sourceRoot":"","sources":["../../src/functions/managedIdentifierFunctions.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2EAAyE;AACzE,2EAAoF;AACpF,6EAA4E;AAC5E,yEAA2F;AAE3F,iCAA+C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AAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAA;AAChG,CAAC;AAFD,oEAEC;AAED,SAAgB,4BAA4B,CAAC,MAAoC;IAC/E,OAAO,MAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAA;AAChG,CAAC;AAFD,oEAEC;AAED,SAAgB,4BAA4B,CAAC,MAAoC;IAC/E,OAAO,MAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAA;AAChG,CAAC;AAFD,oEAEC;AAED,SAAgB,4BAA4B,CAAC,MAAoC;IAC/E,OAAO,MAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,QAAQ,IAAI,MAAM,IAAI,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.
|
|
3
|
+
"version": "0.24.1-unstable.90+75fd054",
|
|
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.
|
|
19
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.24.1-unstable.
|
|
20
|
-
"@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-unstable.
|
|
18
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.24.1-unstable.90+75fd054",
|
|
19
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.24.1-unstable.90+75fd054",
|
|
20
|
+
"@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-unstable.90+75fd054",
|
|
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.
|
|
31
|
-
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-unstable.
|
|
32
|
-
"@sphereon/ssi-sdk-ext.key-manager": "0.24.1-unstable.
|
|
33
|
-
"@sphereon/ssi-sdk-ext.kms-local": "0.24.1-unstable.
|
|
30
|
+
"@sphereon/ssi-sdk-ext.did-provider-jwk": "0.24.1-unstable.90+75fd054",
|
|
31
|
+
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.24.1-unstable.90+75fd054",
|
|
32
|
+
"@sphereon/ssi-sdk-ext.key-manager": "0.24.1-unstable.90+75fd054",
|
|
33
|
+
"@sphereon/ssi-sdk-ext.kms-local": "0.24.1-unstable.90+75fd054",
|
|
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": "
|
|
67
|
+
"gitHead": "75fd0548fa2f4542b7f06c4571ff82ed04d024ad"
|
|
68
68
|
}
|
package/plugin.schema.json
CHANGED
|
@@ -1293,6 +1293,9 @@
|
|
|
1293
1293
|
"method": {
|
|
1294
1294
|
"$ref": "#/components/schemas/ManagedIdentifierMethod"
|
|
1295
1295
|
},
|
|
1296
|
+
"opts": {
|
|
1297
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1298
|
+
},
|
|
1296
1299
|
"key": {
|
|
1297
1300
|
"$ref": "#/components/schemas/IKey"
|
|
1298
1301
|
},
|
|
@@ -1317,6 +1320,7 @@
|
|
|
1317
1320
|
"key",
|
|
1318
1321
|
"kmsKeyRef",
|
|
1319
1322
|
"method",
|
|
1323
|
+
"opts",
|
|
1320
1324
|
"x5c"
|
|
1321
1325
|
]
|
|
1322
1326
|
},
|
|
@@ -1335,6 +1339,9 @@
|
|
|
1335
1339
|
"method": {
|
|
1336
1340
|
"$ref": "#/components/schemas/ManagedIdentifierMethod"
|
|
1337
1341
|
},
|
|
1342
|
+
"opts": {
|
|
1343
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1344
|
+
},
|
|
1338
1345
|
"key": {
|
|
1339
1346
|
"$ref": "#/components/schemas/IKey"
|
|
1340
1347
|
},
|
|
@@ -1373,7 +1380,8 @@
|
|
|
1373
1380
|
"keys",
|
|
1374
1381
|
"kid",
|
|
1375
1382
|
"kmsKeyRef",
|
|
1376
|
-
"method"
|
|
1383
|
+
"method",
|
|
1384
|
+
"opts"
|
|
1377
1385
|
]
|
|
1378
1386
|
},
|
|
1379
1387
|
{
|
|
@@ -1391,6 +1399,9 @@
|
|
|
1391
1399
|
"method": {
|
|
1392
1400
|
"$ref": "#/components/schemas/ManagedIdentifierMethod"
|
|
1393
1401
|
},
|
|
1402
|
+
"opts": {
|
|
1403
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1404
|
+
},
|
|
1394
1405
|
"key": {
|
|
1395
1406
|
"$ref": "#/components/schemas/IKey"
|
|
1396
1407
|
},
|
|
@@ -1406,7 +1417,8 @@
|
|
|
1406
1417
|
"jwkThumbprint",
|
|
1407
1418
|
"key",
|
|
1408
1419
|
"kmsKeyRef",
|
|
1409
|
-
"method"
|
|
1420
|
+
"method",
|
|
1421
|
+
"opts"
|
|
1410
1422
|
]
|
|
1411
1423
|
},
|
|
1412
1424
|
{
|
|
@@ -1424,6 +1436,9 @@
|
|
|
1424
1436
|
"method": {
|
|
1425
1437
|
"$ref": "#/components/schemas/ManagedIdentifierMethod"
|
|
1426
1438
|
},
|
|
1439
|
+
"opts": {
|
|
1440
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1441
|
+
},
|
|
1427
1442
|
"key": {
|
|
1428
1443
|
"$ref": "#/components/schemas/IKey"
|
|
1429
1444
|
},
|
|
@@ -1441,7 +1456,8 @@
|
|
|
1441
1456
|
"key",
|
|
1442
1457
|
"kid",
|
|
1443
1458
|
"kmsKeyRef",
|
|
1444
|
-
"method"
|
|
1459
|
+
"method",
|
|
1460
|
+
"opts"
|
|
1445
1461
|
]
|
|
1446
1462
|
},
|
|
1447
1463
|
{
|
|
@@ -1459,6 +1475,9 @@
|
|
|
1459
1475
|
"method": {
|
|
1460
1476
|
"$ref": "#/components/schemas/ManagedIdentifierMethod"
|
|
1461
1477
|
},
|
|
1478
|
+
"opts": {
|
|
1479
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1480
|
+
},
|
|
1462
1481
|
"key": {
|
|
1463
1482
|
"$ref": "#/components/schemas/IKey"
|
|
1464
1483
|
},
|
|
@@ -1476,7 +1495,8 @@
|
|
|
1476
1495
|
"key",
|
|
1477
1496
|
"kid",
|
|
1478
1497
|
"kmsKeyRef",
|
|
1479
|
-
"method"
|
|
1498
|
+
"method",
|
|
1499
|
+
"opts"
|
|
1480
1500
|
]
|
|
1481
1501
|
}
|
|
1482
1502
|
]
|
|
@@ -1546,6 +1566,9 @@
|
|
|
1546
1566
|
"type": "string",
|
|
1547
1567
|
"const": "did"
|
|
1548
1568
|
},
|
|
1569
|
+
"opts": {
|
|
1570
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1571
|
+
},
|
|
1549
1572
|
"key": {
|
|
1550
1573
|
"$ref": "#/components/schemas/IKey"
|
|
1551
1574
|
},
|
|
@@ -1584,7 +1607,8 @@
|
|
|
1584
1607
|
"keys",
|
|
1585
1608
|
"kid",
|
|
1586
1609
|
"kmsKeyRef",
|
|
1587
|
-
"method"
|
|
1610
|
+
"method",
|
|
1611
|
+
"opts"
|
|
1588
1612
|
]
|
|
1589
1613
|
},
|
|
1590
1614
|
"ManagedIdentifierJwkOpts": {
|
|
@@ -1627,6 +1651,9 @@
|
|
|
1627
1651
|
"type": "string",
|
|
1628
1652
|
"const": "jwk"
|
|
1629
1653
|
},
|
|
1654
|
+
"opts": {
|
|
1655
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1656
|
+
},
|
|
1630
1657
|
"key": {
|
|
1631
1658
|
"$ref": "#/components/schemas/IKey"
|
|
1632
1659
|
},
|
|
@@ -1642,7 +1669,8 @@
|
|
|
1642
1669
|
"jwkThumbprint",
|
|
1643
1670
|
"key",
|
|
1644
1671
|
"kmsKeyRef",
|
|
1645
|
-
"method"
|
|
1672
|
+
"method",
|
|
1673
|
+
"opts"
|
|
1646
1674
|
]
|
|
1647
1675
|
},
|
|
1648
1676
|
"ManagedIdentifierKeyOpts": {
|
|
@@ -1685,6 +1713,9 @@
|
|
|
1685
1713
|
"type": "string",
|
|
1686
1714
|
"const": "key"
|
|
1687
1715
|
},
|
|
1716
|
+
"opts": {
|
|
1717
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1718
|
+
},
|
|
1688
1719
|
"key": {
|
|
1689
1720
|
"$ref": "#/components/schemas/IKey"
|
|
1690
1721
|
},
|
|
@@ -1702,7 +1733,8 @@
|
|
|
1702
1733
|
"key",
|
|
1703
1734
|
"kid",
|
|
1704
1735
|
"kmsKeyRef",
|
|
1705
|
-
"method"
|
|
1736
|
+
"method",
|
|
1737
|
+
"opts"
|
|
1706
1738
|
]
|
|
1707
1739
|
},
|
|
1708
1740
|
"ManagedIdentifierKidOpts": {
|
|
@@ -1745,6 +1777,9 @@
|
|
|
1745
1777
|
"type": "string",
|
|
1746
1778
|
"const": "kid"
|
|
1747
1779
|
},
|
|
1780
|
+
"opts": {
|
|
1781
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1782
|
+
},
|
|
1748
1783
|
"key": {
|
|
1749
1784
|
"$ref": "#/components/schemas/IKey"
|
|
1750
1785
|
},
|
|
@@ -1762,7 +1797,8 @@
|
|
|
1762
1797
|
"key",
|
|
1763
1798
|
"kid",
|
|
1764
1799
|
"kmsKeyRef",
|
|
1765
|
-
"method"
|
|
1800
|
+
"method",
|
|
1801
|
+
"opts"
|
|
1766
1802
|
]
|
|
1767
1803
|
},
|
|
1768
1804
|
"ManagedIdentifierX5cOpts": {
|
|
@@ -1805,6 +1841,9 @@
|
|
|
1805
1841
|
"type": "string",
|
|
1806
1842
|
"const": "x5c"
|
|
1807
1843
|
},
|
|
1844
|
+
"opts": {
|
|
1845
|
+
"$ref": "#/components/schemas/ManagedIdentifierOpts"
|
|
1846
|
+
},
|
|
1808
1847
|
"key": {
|
|
1809
1848
|
"$ref": "#/components/schemas/IKey"
|
|
1810
1849
|
},
|
|
@@ -1829,6 +1868,7 @@
|
|
|
1829
1868
|
"key",
|
|
1830
1869
|
"kmsKeyRef",
|
|
1831
1870
|
"method",
|
|
1871
|
+
"opts",
|
|
1832
1872
|
"x5c"
|
|
1833
1873
|
]
|
|
1834
1874
|
}
|
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
import {IRequiredContext} from
|
|
2
|
-
import {getFirstKeyWithRelation} from '@sphereon/ssi-sdk-ext.did-utils'
|
|
3
|
-
import {calculateJwkThumbprint, JWK, toJwk} from '@sphereon/ssi-sdk-ext.key-utils'
|
|
4
|
-
import {pemOrDerToX509Certificate} from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
5
|
-
import {contextHasDidManager, contextHasKeyManager} from '@sphereon/ssi-sdk.agent-config'
|
|
6
|
-
import {IAgentContext, IIdentifier, IKey, IKeyManager} from '@veramo/core'
|
|
7
|
-
import {CryptoEngine, setEngine} from 'pkijs'
|
|
1
|
+
import { IRequiredContext } from '@sphereon/ssi-sdk-ext.did-provider-jwk'
|
|
2
|
+
import { getFirstKeyWithRelation } from '@sphereon/ssi-sdk-ext.did-utils'
|
|
3
|
+
import { calculateJwkThumbprint, JWK, toJwk } from '@sphereon/ssi-sdk-ext.key-utils'
|
|
4
|
+
import { pemOrDerToX509Certificate } from '@sphereon/ssi-sdk-ext.x509-utils'
|
|
5
|
+
import { contextHasDidManager, contextHasKeyManager } from '@sphereon/ssi-sdk.agent-config'
|
|
6
|
+
import { IAgentContext, IIdentifier, IKey, IKeyManager } from '@veramo/core'
|
|
7
|
+
import { CryptoEngine, setEngine } from 'pkijs'
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
isManagedIdentifierDidOpts,
|
|
10
|
+
isManagedIdentifierDidResult,
|
|
11
|
+
isManagedIdentifierJwkOpts,
|
|
12
|
+
isManagedIdentifierKeyOpts,
|
|
13
|
+
isManagedIdentifierKidOpts,
|
|
14
|
+
isManagedIdentifierX5cOpts,
|
|
15
|
+
ManagedIdentifierDidOpts,
|
|
16
|
+
ManagedIdentifierDidResult,
|
|
17
|
+
ManagedIdentifierJwkOpts,
|
|
18
|
+
ManagedIdentifierJwkResult,
|
|
19
|
+
ManagedIdentifierKeyOpts,
|
|
20
|
+
ManagedIdentifierKeyResult,
|
|
21
|
+
ManagedIdentifierKidOpts,
|
|
22
|
+
ManagedIdentifierKidResult,
|
|
23
|
+
ManagedIdentifierOpts,
|
|
24
|
+
ManagedIdentifierOptsOrResult,
|
|
25
|
+
ManagedIdentifierResult,
|
|
26
|
+
ManagedIdentifierX5cOpts,
|
|
27
|
+
ManagedIdentifierX5cResult,
|
|
27
28
|
} from '../types'
|
|
28
29
|
|
|
29
30
|
export async function getManagedKidIdentifier(
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
opts: ManagedIdentifierKidOpts,
|
|
32
|
+
context: IAgentContext<IKeyManager>
|
|
32
33
|
): Promise<ManagedIdentifierKidResult> {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
const method = 'kid'
|
|
35
|
+
if (!contextHasKeyManager(context)) {
|
|
36
|
+
return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
|
|
37
|
+
}
|
|
38
|
+
const key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? opts.identifier })
|
|
39
|
+
const jwk = toJwk(key.publicKeyHex, key.type, { key })
|
|
40
|
+
const jwkThumbprint = (key.meta?.jwkThumbprint as string) ?? calculateJwkThumbprint({ jwk })
|
|
41
|
+
const kid = opts.kid ?? (key.meta?.verificationMethod?.id as string) ?? jwkThumbprint
|
|
42
|
+
const issuer = opts.issuer ?? kid // The different identifiers should set the value. Defaults to the kid
|
|
43
|
+
return {
|
|
44
|
+
method,
|
|
45
|
+
key,
|
|
46
|
+
jwk,
|
|
47
|
+
jwkThumbprint,
|
|
48
|
+
kid,
|
|
49
|
+
issuer,
|
|
50
|
+
kmsKeyRef: key.kid,
|
|
51
|
+
opts,
|
|
52
|
+
} satisfies ManagedIdentifierKidResult
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
|
|
54
55
|
/**
|
|
55
56
|
* 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
|
* @param identifier
|
|
57
58
|
* @param context
|
|
58
59
|
*/
|
|
59
|
-
export async function ensureManagedIdentifierResult(
|
|
60
|
-
|
|
60
|
+
export async function ensureManagedIdentifierResult(
|
|
61
|
+
identifier: ManagedIdentifierOptsOrResult,
|
|
62
|
+
context: IRequiredContext
|
|
63
|
+
): Promise<ManagedIdentifierResult> {
|
|
64
|
+
return 'key' in identifier && 'kmsKeyRef' in identifier && 'method' in identifier && !('identifier' in identifier)
|
|
65
|
+
? identifier
|
|
66
|
+
: await context.agent.identifierManagedGet(identifier)
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
/**
|
|
@@ -66,155 +72,164 @@ export async function ensureManagedIdentifierResult(identifier: ManagedIdentifie
|
|
|
66
72
|
* @param _context
|
|
67
73
|
*/
|
|
68
74
|
export async function getManagedKeyIdentifier(opts: ManagedIdentifierKeyOpts, _context?: IAgentContext<any>): Promise<ManagedIdentifierKeyResult> {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
const method = 'key'
|
|
76
|
+
const key: IKey = opts.identifier
|
|
77
|
+
if (opts.kmsKeyRef && opts.kmsKeyRef !== key.kid) {
|
|
78
|
+
return Promise.reject(Error(`Cannot get a managed key object by providing a key and a kmsKeyRef that are different.}`))
|
|
79
|
+
}
|
|
80
|
+
const jwk = toJwk(key.publicKeyHex, key.type, { key })
|
|
81
|
+
const jwkThumbprint = (key.meta?.jwkThumbprint as string) ?? calculateJwkThumbprint({ jwk })
|
|
82
|
+
const kid = opts.kid ?? (key.meta?.verificationMethod?.id as string) ?? jwkThumbprint
|
|
83
|
+
const issuer = opts.issuer ?? kid // The different identifiers should set the value. Defaults to the kid
|
|
84
|
+
return {
|
|
85
|
+
method,
|
|
86
|
+
key,
|
|
87
|
+
jwk,
|
|
88
|
+
jwkThumbprint,
|
|
89
|
+
kid,
|
|
90
|
+
issuer,
|
|
91
|
+
kmsKeyRef: key.kid,
|
|
92
|
+
opts,
|
|
93
|
+
} satisfies ManagedIdentifierKeyResult
|
|
87
94
|
}
|
|
88
95
|
|
|
89
96
|
export async function getManagedDidIdentifier(opts: ManagedIdentifierDidOpts, context: IAgentContext<any>): Promise<ManagedIdentifierDidResult> {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
const method = 'did'
|
|
98
|
+
if (!contextHasDidManager(context)) {
|
|
99
|
+
return Promise.reject(Error(`Cannot get DID identifier if DID Manager plugin is not enabled!`))
|
|
100
|
+
}
|
|
94
101
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
let identifier: IIdentifier
|
|
103
|
+
if (typeof opts.identifier === 'string') {
|
|
104
|
+
identifier = await context.agent.didManagerGet({ did: opts.identifier.split('#')[0] })
|
|
105
|
+
} else {
|
|
106
|
+
identifier = opts.identifier
|
|
107
|
+
}
|
|
101
108
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
109
|
+
const did = identifier.did
|
|
110
|
+
const keys = identifier?.keys // fixme: We really want to return the vmRelationship keys here actually
|
|
111
|
+
const extendedKey = await getFirstKeyWithRelation(
|
|
112
|
+
{
|
|
113
|
+
...opts,
|
|
114
|
+
identifier,
|
|
115
|
+
vmRelationship: opts.vmRelationship ?? 'verificationMethod',
|
|
116
|
+
},
|
|
117
|
+
context
|
|
118
|
+
)
|
|
119
|
+
const key = extendedKey
|
|
120
|
+
const controllerKeyId = identifier.controllerKeyId
|
|
121
|
+
const jwk = toJwk(key.publicKeyHex, key.type, { key })
|
|
122
|
+
const jwkThumbprint = key.meta?.jwkThumbprint ?? calculateJwkThumbprint({ jwk })
|
|
123
|
+
let kid = opts.kid ?? extendedKey.meta?.verificationMethod?.id
|
|
124
|
+
if (!kid.startsWith(did)) {
|
|
125
|
+
// Make sure we create a fully qualified kid
|
|
126
|
+
const hash = kid.startsWith('#') ? '' : '#'
|
|
127
|
+
kid = `${did}${hash}${kid}`
|
|
128
|
+
}
|
|
129
|
+
const issuer = opts.issuer ?? did
|
|
130
|
+
return {
|
|
131
|
+
method,
|
|
132
|
+
key,
|
|
133
|
+
did,
|
|
134
|
+
kmsKeyRef: key.kid,
|
|
135
|
+
jwk,
|
|
136
|
+
jwkThumbprint,
|
|
137
|
+
controllerKeyId,
|
|
138
|
+
kid,
|
|
139
|
+
keys,
|
|
140
|
+
issuer,
|
|
141
|
+
identifier,
|
|
142
|
+
opts,
|
|
143
|
+
}
|
|
131
144
|
}
|
|
132
145
|
|
|
133
146
|
export async function getManagedJwkIdentifier(
|
|
134
|
-
|
|
135
|
-
|
|
147
|
+
opts: ManagedIdentifierJwkOpts,
|
|
148
|
+
context: IAgentContext<IKeyManager>
|
|
136
149
|
): Promise<ManagedIdentifierJwkResult> {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
const method = 'jwk'
|
|
151
|
+
const { kid, issuer } = opts
|
|
152
|
+
if (!contextHasKeyManager(context)) {
|
|
153
|
+
return Promise.reject(Error(`Cannot get Key/JWK identifier if KeyManager plugin is not enabled!`))
|
|
154
|
+
}
|
|
155
|
+
const key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? calculateJwkThumbprint({ jwk: opts.identifier }) })
|
|
156
|
+
const jwk = opts.identifier ?? toJwk(key.publicKeyHex, key.type, { key })
|
|
157
|
+
const jwkThumbprint = (key.meta?.jwkThumbprint as string) ?? calculateJwkThumbprint({ jwk })
|
|
158
|
+
// 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.
|
|
159
|
+
return {
|
|
160
|
+
method,
|
|
161
|
+
key,
|
|
162
|
+
kmsKeyRef: key.kid,
|
|
163
|
+
jwk,
|
|
164
|
+
jwkThumbprint,
|
|
165
|
+
kid,
|
|
166
|
+
issuer,
|
|
167
|
+
opts,
|
|
168
|
+
} satisfies ManagedIdentifierJwkResult
|
|
155
169
|
}
|
|
156
170
|
|
|
157
171
|
export async function getManagedX5cIdentifier(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
172
|
+
opts: ManagedIdentifierX5cOpts & {
|
|
173
|
+
crypto?: Crypto
|
|
174
|
+
},
|
|
175
|
+
context: IAgentContext<IKeyManager>
|
|
162
176
|
): Promise<ManagedIdentifierX5cResult> {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
const { kid, issuer } = opts
|
|
178
|
+
const method = 'x5c'
|
|
179
|
+
const x5c = opts.identifier
|
|
180
|
+
if (x5c.length === 0) {
|
|
181
|
+
return Promise.reject(`Cannot resolve x5c when an empty x5c is passed in`)
|
|
182
|
+
} else if (!contextHasKeyManager(context)) {
|
|
183
|
+
return Promise.reject(Error(`Cannot get X5c identifier if KeyManager plugin is not enabled!`))
|
|
184
|
+
}
|
|
185
|
+
const cryptoImpl = opts.crypto ?? crypto
|
|
186
|
+
const certificate = pemOrDerToX509Certificate(x5c[0])
|
|
187
|
+
const cryptoEngine = new CryptoEngine({ name: 'identifier_resolver_managed', crypto: cryptoImpl })
|
|
188
|
+
setEngine(cryptoEngine.name, cryptoEngine)
|
|
189
|
+
const pk = await certificate.getPublicKey(undefined, cryptoEngine)
|
|
190
|
+
const jwk = (await cryptoEngine.subtle.exportKey('jwk', pk)) as JWK
|
|
191
|
+
const jwkThumbprint = calculateJwkThumbprint({ jwk })
|
|
192
|
+
const key = await context.agent.keyManagerGet({ kid: opts.kmsKeyRef ?? jwkThumbprint })
|
|
193
|
+
// 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.
|
|
180
194
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
return {
|
|
196
|
+
method,
|
|
197
|
+
x5c,
|
|
198
|
+
certificate,
|
|
199
|
+
jwk,
|
|
200
|
+
jwkThumbprint,
|
|
201
|
+
key,
|
|
202
|
+
kmsKeyRef: key.kid,
|
|
203
|
+
kid,
|
|
204
|
+
issuer,
|
|
205
|
+
opts,
|
|
206
|
+
} satisfies ManagedIdentifierX5cResult
|
|
192
207
|
}
|
|
193
208
|
|
|
194
209
|
export async function getManagedIdentifier(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
210
|
+
opts: ManagedIdentifierOpts & {
|
|
211
|
+
crypto?: Crypto
|
|
212
|
+
},
|
|
213
|
+
context: IAgentContext<IKeyManager>
|
|
199
214
|
): Promise<ManagedIdentifierResult> {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
let resolutionResult: ManagedIdentifierResult
|
|
216
|
+
if (isManagedIdentifierKidOpts(opts)) {
|
|
217
|
+
resolutionResult = await getManagedKidIdentifier(opts, context)
|
|
218
|
+
} else if (isManagedIdentifierDidOpts(opts)) {
|
|
219
|
+
resolutionResult = await getManagedDidIdentifier(opts, context)
|
|
220
|
+
} else if (isManagedIdentifierJwkOpts(opts)) {
|
|
221
|
+
resolutionResult = await getManagedJwkIdentifier(opts, context)
|
|
222
|
+
} else if (isManagedIdentifierX5cOpts(opts)) {
|
|
223
|
+
resolutionResult = await getManagedX5cIdentifier(opts, context)
|
|
224
|
+
} else if (isManagedIdentifierKeyOpts(opts)) {
|
|
225
|
+
resolutionResult = await getManagedKeyIdentifier(opts, context)
|
|
226
|
+
} else {
|
|
227
|
+
return Promise.reject(Error(`Could not determine identifier method. Please provide explicitly`))
|
|
228
|
+
}
|
|
229
|
+
const { key } = resolutionResult
|
|
230
|
+
if (!key || (isManagedIdentifierDidOpts(opts) && isManagedIdentifierDidResult(resolutionResult) && !resolutionResult.identifier)) {
|
|
231
|
+
console.log(`Cannot find identifier`, opts.identifier)
|
|
232
|
+
return Promise.reject(`Cannot find identifier ${opts.identifier}`)
|
|
233
|
+
}
|
|
234
|
+
return resolutionResult
|
|
220
235
|
}
|
|
@@ -87,6 +87,7 @@ export interface ManagedJwkInfo extends JwkInfo {
|
|
|
87
87
|
|
|
88
88
|
export interface IManagedIdentifierResultBase extends ManagedJwkInfo {
|
|
89
89
|
method: ManagedIdentifierMethod
|
|
90
|
+
opts: ManagedIdentifierOpts
|
|
90
91
|
key: IKey
|
|
91
92
|
kid?: string
|
|
92
93
|
issuer?: string
|
|
@@ -151,5 +152,4 @@ export type ManagedIdentifierMethod = 'did' | 'jwk' | 'x5c' | 'kid' | 'key'
|
|
|
151
152
|
export type ManagedIdentifierResult = IManagedIdentifierResultBase &
|
|
152
153
|
(ManagedIdentifierX5cResult | ManagedIdentifierDidResult | ManagedIdentifierJwkResult | ManagedIdentifierKidResult | ManagedIdentifierKeyResult)
|
|
153
154
|
|
|
154
|
-
|
|
155
155
|
export type ManagedIdentifierOptsOrResult = ManagedIdentifierResult | ManagedIdentifierOpts
|