@sphereon/ssi-sdk-ext.did-utils 0.13.0 → 0.13.1-unstable.3
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/did-functions.js +157 -230
- package/dist/did-functions.js.map +1 -1
- package/dist/index.js +2 -18
- package/dist/index.js.map +1 -1
- package/dist/types.js +1 -4
- package/dist/types.js.map +1 -1
- package/package.json +6 -5
package/dist/did-functions.js
CHANGED
|
@@ -1,61 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
35
|
-
var t = {};
|
|
36
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
37
|
-
t[p] = s[p];
|
|
38
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
39
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
40
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
41
|
-
t[p[i]] = s[p[i]];
|
|
42
|
-
}
|
|
43
|
-
return t;
|
|
44
|
-
};
|
|
45
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
-
};
|
|
48
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
|
-
exports.asDidWeb = exports.toDidResolutionResult = exports.toDidDocument = exports.AgentDIDResolver = exports.getAgentResolver = exports.getSupportedDIDMethods = exports.determineKid = exports.getKey = exports.toDIDs = exports.toDID = exports.getDID = exports.getIdentifier = exports.getAgentDIDMethods = exports.mapIdentifierKeysToDocWithJwkSupport = exports.extractPublicKeyHexWithJwkSupport = exports.dereferenceDidKeysWithJwkSupport = exports.getFirstKeyWithRelation = void 0;
|
|
50
|
-
const did_uni_client_1 = require("@sphereon/did-uni-client");
|
|
51
|
-
const utils_1 = require("@veramo/utils");
|
|
1
|
+
import { UniResolver } from '@sphereon/did-uni-client';
|
|
2
|
+
import { extractPublicKeyHex, isDefined, mapIdentifierKeysToDoc, resolveDidOrThrow, } from '@veramo/utils';
|
|
52
3
|
// @ts-ignore
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const getFirstKeyWithRelation = (identifier, context, vmRelationship, errorOnNotFound) =>
|
|
57
|
-
const section = vmRelationship
|
|
58
|
-
const matchedKeys =
|
|
4
|
+
import elliptic from 'elliptic';
|
|
5
|
+
import * as u8a from 'uint8arrays';
|
|
6
|
+
import { ENC_KEY_ALGS, hexKeyFromPEMBasedJwk, JwkKeyUse, toJwk } from '@sphereon/ssi-sdk-ext.key-utils';
|
|
7
|
+
export const getFirstKeyWithRelation = async (identifier, context, vmRelationship, errorOnNotFound) => {
|
|
8
|
+
const section = vmRelationship ?? 'verificationMethod'; // search all VMs in case no relationship is provided
|
|
9
|
+
const matchedKeys = await mapIdentifierKeysToDocWithJwkSupport(identifier, section, context);
|
|
59
10
|
if (Array.isArray(matchedKeys) && matchedKeys.length > 0) {
|
|
60
11
|
return matchedKeys[0];
|
|
61
12
|
}
|
|
@@ -63,8 +14,7 @@ const getFirstKeyWithRelation = (identifier, context, vmRelationship, errorOnNot
|
|
|
63
14
|
throw new Error(`Could not find key with relationship ${section} in DID document for ${identifier.did}`);
|
|
64
15
|
}
|
|
65
16
|
return undefined;
|
|
66
|
-
}
|
|
67
|
-
exports.getFirstKeyWithRelation = getFirstKeyWithRelation;
|
|
17
|
+
};
|
|
68
18
|
//TODO: Move to ssi-sdk/core and create PR upstream
|
|
69
19
|
/**
|
|
70
20
|
* Dereferences keys from DID document and normalizes them for easy comparison.
|
|
@@ -76,42 +26,39 @@ exports.getFirstKeyWithRelation = getFirstKeyWithRelation;
|
|
|
76
26
|
*
|
|
77
27
|
* @beta This API may change without a BREAKING CHANGE notice.
|
|
78
28
|
*/
|
|
79
|
-
function dereferenceDidKeysWithJwkSupport(didDocument, section = 'keyAgreement', context) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}));
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
return key;
|
|
29
|
+
export async function dereferenceDidKeysWithJwkSupport(didDocument, section = 'keyAgreement', context) {
|
|
30
|
+
const convert = section === 'keyAgreement';
|
|
31
|
+
if (section === 'service') {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return (await Promise.all((didDocument[section] || []).map(async (key) => {
|
|
35
|
+
if (typeof key === 'string') {
|
|
36
|
+
try {
|
|
37
|
+
return (await context.agent.getDIDComponentById({
|
|
38
|
+
didDocument,
|
|
39
|
+
didUrl: key,
|
|
40
|
+
section,
|
|
41
|
+
}));
|
|
100
42
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
.map((key) => {
|
|
104
|
-
const hexKey = extractPublicKeyHexWithJwkSupport(key, convert);
|
|
105
|
-
const { publicKeyHex, publicKeyBase58, publicKeyBase64, publicKeyJwk } = key, keyProps = __rest(key, ["publicKeyHex", "publicKeyBase58", "publicKeyBase64", "publicKeyJwk"]);
|
|
106
|
-
const newKey = Object.assign(Object.assign({}, keyProps), { publicKeyHex: hexKey });
|
|
107
|
-
if (convert && 'Ed25519VerificationKey2018' === newKey.type) {
|
|
108
|
-
newKey.type = 'X25519KeyAgreementKey2019';
|
|
43
|
+
catch (e) {
|
|
44
|
+
return null;
|
|
109
45
|
}
|
|
110
|
-
|
|
111
|
-
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return key;
|
|
49
|
+
}
|
|
50
|
+
})))
|
|
51
|
+
.filter(isDefined)
|
|
52
|
+
.map((key) => {
|
|
53
|
+
const hexKey = extractPublicKeyHexWithJwkSupport(key, convert);
|
|
54
|
+
const { publicKeyHex, publicKeyBase58, publicKeyBase64, publicKeyJwk, ...keyProps } = key;
|
|
55
|
+
const newKey = { ...keyProps, publicKeyHex: hexKey };
|
|
56
|
+
if (convert && 'Ed25519VerificationKey2018' === newKey.type) {
|
|
57
|
+
newKey.type = 'X25519KeyAgreementKey2019';
|
|
58
|
+
}
|
|
59
|
+
return newKey;
|
|
112
60
|
});
|
|
113
61
|
}
|
|
114
|
-
exports.dereferenceDidKeysWithJwkSupport = dereferenceDidKeysWithJwkSupport;
|
|
115
62
|
/**
|
|
116
63
|
* Converts the publicKey of a VerificationMethod to hex encoding (publicKeyHex)
|
|
117
64
|
*
|
|
@@ -121,10 +68,10 @@ exports.dereferenceDidKeysWithJwkSupport = dereferenceDidKeysWithJwkSupport;
|
|
|
121
68
|
*
|
|
122
69
|
* @beta This API may change without a BREAKING CHANGE notice.
|
|
123
70
|
*/
|
|
124
|
-
function extractPublicKeyHexWithJwkSupport(pk, convert = false) {
|
|
71
|
+
export function extractPublicKeyHexWithJwkSupport(pk, convert = false) {
|
|
125
72
|
if (pk.publicKeyJwk) {
|
|
126
73
|
if (pk.publicKeyJwk.kty === 'EC') {
|
|
127
|
-
const secp256 = new
|
|
74
|
+
const secp256 = new elliptic.ec(pk.publicKeyJwk.crv === 'secp256k1' ? 'secp256k1' : 'p256');
|
|
128
75
|
// const prefix = pk.publicKeyJwk.crv === 'secp256k1' ? '04' : '03'
|
|
129
76
|
const x = u8a.fromString(pk.publicKeyJwk.x, 'base64url');
|
|
130
77
|
const y = u8a.fromString(pk.publicKeyJwk.y, 'base64url');
|
|
@@ -143,13 +90,12 @@ function extractPublicKeyHexWithJwkSupport(pk, convert = false) {
|
|
|
143
90
|
return u8a.toString(u8a.fromString(pk.publicKeyJwk.x, 'base64url'), 'base16');
|
|
144
91
|
}
|
|
145
92
|
else if (pk.publicKeyJwk.kty === 'RSA') {
|
|
146
|
-
return
|
|
93
|
+
return hexKeyFromPEMBasedJwk(pk.publicKeyJwk, 'public');
|
|
147
94
|
}
|
|
148
95
|
}
|
|
149
96
|
// delegate the other types to the original Veramo function
|
|
150
|
-
return
|
|
97
|
+
return extractPublicKeyHex(pk, convert);
|
|
151
98
|
}
|
|
152
|
-
exports.extractPublicKeyHexWithJwkSupport = extractPublicKeyHexWithJwkSupport;
|
|
153
99
|
/**
|
|
154
100
|
* Maps the keys of a locally managed {@link @veramo/core#IIdentifier | IIdentifier} to the corresponding
|
|
155
101
|
* {@link did-resolver#VerificationMethod | VerificationMethod} entries from the DID document.
|
|
@@ -166,54 +112,45 @@ exports.extractPublicKeyHexWithJwkSupport = extractPublicKeyHexWithJwkSupport;
|
|
|
166
112
|
*
|
|
167
113
|
* @beta This API may change without a BREAKING CHANGE notice.
|
|
168
114
|
*/
|
|
169
|
-
function mapIdentifierKeysToDocWithJwkSupport(identifier, section = 'keyAgreement', context, didDocument) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
return Object.assign(Object.assign({}, localProps), { meta: Object.assign(Object.assign({}, meta), { verificationMethod }) });
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
})
|
|
193
|
-
.filter(utils_1.isDefined);
|
|
194
|
-
return keys.concat(extendedKeys);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
exports.mapIdentifierKeysToDocWithJwkSupport = mapIdentifierKeysToDocWithJwkSupport;
|
|
198
|
-
function getAgentDIDMethods(context) {
|
|
199
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
-
return (yield context.agent.didManagerGetProviders()).map((provider) => provider.toLowerCase().replace('did:', ''));
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
exports.getAgentDIDMethods = getAgentDIDMethods;
|
|
204
|
-
function getIdentifier(identifierOpts, context) {
|
|
205
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
-
if (typeof identifierOpts.identifier === 'string') {
|
|
207
|
-
return context.agent.didManagerGet({ did: identifierOpts.identifier });
|
|
115
|
+
export async function mapIdentifierKeysToDocWithJwkSupport(identifier, section = 'keyAgreement', context, didDocument) {
|
|
116
|
+
const rsaDidWeb = identifier.keys && identifier.keys.length > 0 && identifier.keys[0].type === 'RSA' && didDocument;
|
|
117
|
+
// We skip mapping in case the identifier is RSA and a did document is supplied.
|
|
118
|
+
const keys = rsaDidWeb ? [] : await mapIdentifierKeysToDoc(identifier, section, context);
|
|
119
|
+
const didDoc = didDocument ? didDocument : await resolveDidOrThrow(identifier.did, context);
|
|
120
|
+
// dereference all key agreement keys from DID document and normalize
|
|
121
|
+
const documentKeys = await dereferenceDidKeysWithJwkSupport(didDoc, section, context);
|
|
122
|
+
const localKeys = identifier.keys.filter(isDefined);
|
|
123
|
+
// finally map the didDocument keys to the identifier keys by comparing `publicKeyHex`
|
|
124
|
+
const extendedKeys = documentKeys
|
|
125
|
+
.map((verificationMethod) => {
|
|
126
|
+
/*if (verificationMethod.type !== 'JsonWebKey2020') {
|
|
127
|
+
return null
|
|
128
|
+
}*/
|
|
129
|
+
const localKey = localKeys.find((localKey) => localKey.publicKeyHex === verificationMethod.publicKeyHex || verificationMethod.publicKeyHex?.startsWith(localKey.publicKeyHex));
|
|
130
|
+
if (localKey) {
|
|
131
|
+
const { meta, ...localProps } = localKey;
|
|
132
|
+
return { ...localProps, meta: { ...meta, verificationMethod } };
|
|
208
133
|
}
|
|
209
|
-
else
|
|
210
|
-
return
|
|
134
|
+
else {
|
|
135
|
+
return null;
|
|
211
136
|
}
|
|
212
|
-
|
|
213
|
-
|
|
137
|
+
})
|
|
138
|
+
.filter(isDefined);
|
|
139
|
+
return keys.concat(extendedKeys);
|
|
140
|
+
}
|
|
141
|
+
export async function getAgentDIDMethods(context) {
|
|
142
|
+
return (await context.agent.didManagerGetProviders()).map((provider) => provider.toLowerCase().replace('did:', ''));
|
|
143
|
+
}
|
|
144
|
+
export async function getIdentifier(identifierOpts, context) {
|
|
145
|
+
if (typeof identifierOpts.identifier === 'string') {
|
|
146
|
+
return context.agent.didManagerGet({ did: identifierOpts.identifier });
|
|
147
|
+
}
|
|
148
|
+
else if (typeof identifierOpts.identifier === 'object') {
|
|
149
|
+
return identifierOpts.identifier;
|
|
150
|
+
}
|
|
151
|
+
throw Error(`Cannot get agent identifier value from options`);
|
|
214
152
|
}
|
|
215
|
-
|
|
216
|
-
function getDID(identifierOpts) {
|
|
153
|
+
export function getDID(identifierOpts) {
|
|
217
154
|
if (typeof identifierOpts.identifier === 'string') {
|
|
218
155
|
return identifierOpts.identifier;
|
|
219
156
|
}
|
|
@@ -222,8 +159,7 @@ function getDID(identifierOpts) {
|
|
|
222
159
|
}
|
|
223
160
|
throw Error(`Cannot get DID from identifier value`);
|
|
224
161
|
}
|
|
225
|
-
|
|
226
|
-
function toDID(identifier) {
|
|
162
|
+
export function toDID(identifier) {
|
|
227
163
|
if (typeof identifier === 'string') {
|
|
228
164
|
return identifier;
|
|
229
165
|
}
|
|
@@ -232,130 +168,121 @@ function toDID(identifier) {
|
|
|
232
168
|
}
|
|
233
169
|
throw Error(`No DID value present in identifier`);
|
|
234
170
|
}
|
|
235
|
-
|
|
236
|
-
function toDIDs(identifiers) {
|
|
171
|
+
export function toDIDs(identifiers) {
|
|
237
172
|
if (!identifiers) {
|
|
238
173
|
return [];
|
|
239
174
|
}
|
|
240
175
|
return identifiers.map(toDID);
|
|
241
176
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
return identifierKey;
|
|
254
|
-
});
|
|
177
|
+
export async function getKey(identifier, verificationMethodSection = 'authentication', context, keyId) {
|
|
178
|
+
const keys = await mapIdentifierKeysToDocWithJwkSupport(identifier, verificationMethodSection, context);
|
|
179
|
+
if (!keys || keys.length === 0) {
|
|
180
|
+
throw new Error(`No keys found for verificationMethodSection: ${verificationMethodSection} and did ${identifier.did}`);
|
|
181
|
+
}
|
|
182
|
+
const identifierKey = keyId ? keys.find((key) => key.kid === keyId || key.meta.verificationMethod.id === keyId) : keys[0];
|
|
183
|
+
if (!identifierKey) {
|
|
184
|
+
throw new Error(`No matching verificationMethodSection key found for keyId: ${keyId}`);
|
|
185
|
+
}
|
|
186
|
+
return identifierKey;
|
|
255
187
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
var _a, _b, _c;
|
|
259
|
-
return (_c = (_b = (_a = key.meta) === null || _a === void 0 ? void 0 : _a.verificationMethod.id) !== null && _b !== void 0 ? _b : idOpts.kid) !== null && _c !== void 0 ? _c : key.kid;
|
|
188
|
+
export function determineKid(key, idOpts) {
|
|
189
|
+
return key.meta?.verificationMethod.id ?? idOpts.kid ?? key.kid;
|
|
260
190
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
var _a;
|
|
264
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
-
return (_a = didOpts.supportedDIDMethods) !== null && _a !== void 0 ? _a : (yield getAgentDIDMethods(context));
|
|
266
|
-
});
|
|
191
|
+
export async function getSupportedDIDMethods(didOpts, context) {
|
|
192
|
+
return didOpts.supportedDIDMethods ?? (await getAgentDIDMethods(context));
|
|
267
193
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
var _a;
|
|
271
|
-
return new AgentDIDResolver(context, (_a = opts === null || opts === void 0 ? void 0 : opts.uniresolverFallback) !== null && _a !== void 0 ? _a : true);
|
|
194
|
+
export function getAgentResolver(context, opts) {
|
|
195
|
+
return new AgentDIDResolver(context, opts?.uniresolverFallback ?? true);
|
|
272
196
|
}
|
|
273
|
-
|
|
274
|
-
|
|
197
|
+
export class AgentDIDResolver {
|
|
198
|
+
context;
|
|
199
|
+
uniresolverFallback;
|
|
275
200
|
constructor(context, uniresolverFallback) {
|
|
276
201
|
this.context = context;
|
|
277
202
|
this.uniresolverFallback = uniresolverFallback === true;
|
|
278
203
|
}
|
|
279
|
-
resolve(didUrl, options) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return yield new did_uni_client_1.UniResolver().resolve(didUrl, options);
|
|
287
|
-
}
|
|
288
|
-
throw error;
|
|
204
|
+
async resolve(didUrl, options) {
|
|
205
|
+
try {
|
|
206
|
+
return await this.context.agent.resolveDid({ didUrl, options });
|
|
207
|
+
}
|
|
208
|
+
catch (error) {
|
|
209
|
+
if (this.uniresolverFallback) {
|
|
210
|
+
return await new UniResolver().resolve(didUrl, options);
|
|
289
211
|
}
|
|
290
|
-
|
|
212
|
+
throw error;
|
|
213
|
+
}
|
|
291
214
|
}
|
|
292
215
|
}
|
|
293
|
-
|
|
294
|
-
function toDidDocument(identifier, opts) {
|
|
295
|
-
var _a, _b, _c;
|
|
216
|
+
export function toDidDocument(identifier, opts) {
|
|
296
217
|
let didDocument = undefined;
|
|
297
218
|
if (identifier) {
|
|
298
|
-
const did =
|
|
299
|
-
didDocument =
|
|
219
|
+
const did = identifier.did ?? opts?.did;
|
|
220
|
+
didDocument = {
|
|
221
|
+
'@context': 'https://www.w3.org/ns/did/v1',
|
|
222
|
+
id: did,
|
|
223
|
+
verificationMethod: identifier.keys.map((key) => {
|
|
300
224
|
const vm = {
|
|
301
225
|
controller: did,
|
|
302
226
|
id: key.kid.startsWith(did) && key.kid.includes('#') ? key.kid : `${did}#${key.kid}`,
|
|
303
|
-
publicKeyJwk:
|
|
304
|
-
use:
|
|
227
|
+
publicKeyJwk: toJwk(key.publicKeyHex, key.type, {
|
|
228
|
+
use: ENC_KEY_ALGS.includes(key.type) ? JwkKeyUse.Encryption : JwkKeyUse.Signature,
|
|
305
229
|
key,
|
|
306
230
|
}),
|
|
307
231
|
type: 'JsonWebKey2020',
|
|
308
232
|
};
|
|
309
233
|
return vm;
|
|
310
|
-
}) }, ((!(opts === null || opts === void 0 ? void 0 : opts.use) || ((_b = opts === null || opts === void 0 ? void 0 : opts.use) === null || _b === void 0 ? void 0 : _b.includes(ssi_sdk_ext_key_utils_1.JwkKeyUse.Signature))) &&
|
|
311
|
-
identifier.keys && {
|
|
312
|
-
assertionMethod: identifier.keys.map((key) => {
|
|
313
|
-
return `${did}#${key.kid}`;
|
|
314
234
|
}),
|
|
315
|
-
|
|
316
|
-
|
|
235
|
+
...((!opts?.use || opts?.use?.includes(JwkKeyUse.Signature)) &&
|
|
236
|
+
identifier.keys && {
|
|
237
|
+
assertionMethod: identifier.keys.map((key) => {
|
|
238
|
+
return `${did}#${key.kid}`;
|
|
239
|
+
}),
|
|
240
|
+
authentication: identifier.keys.map((key) => {
|
|
241
|
+
return `${did}#${key.kid}`;
|
|
242
|
+
}),
|
|
317
243
|
}),
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
244
|
+
...((!opts?.use || opts?.use?.includes(JwkKeyUse.Encryption)) &&
|
|
245
|
+
identifier.keys &&
|
|
246
|
+
identifier.keys.filter((key) => key.type === 'X25519').length > 0 && {
|
|
247
|
+
keyAgreement: identifier.keys
|
|
248
|
+
.filter((key) => key.type === 'X25519')
|
|
249
|
+
.map((key) => {
|
|
250
|
+
if (key.kid.startsWith(did) && key.kid.includes('#')) {
|
|
251
|
+
return key.kid;
|
|
252
|
+
}
|
|
253
|
+
return `${did}#${key.kid}`;
|
|
254
|
+
}),
|
|
328
255
|
}),
|
|
329
|
-
|
|
256
|
+
...(identifier.services && identifier.services.length > 0 && { service: identifier.services }),
|
|
257
|
+
};
|
|
330
258
|
}
|
|
331
259
|
return didDocument;
|
|
332
260
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
var _a;
|
|
336
|
-
const didDocument = (_a = toDidDocument(identifier, opts)) !== null && _a !== void 0 ? _a : null; // null is used in case of errors and required by the did resolution spec
|
|
261
|
+
export function toDidResolutionResult(identifier, opts) {
|
|
262
|
+
const didDocument = toDidDocument(identifier, opts) ?? null; // null is used in case of errors and required by the did resolution spec
|
|
337
263
|
const resolutionResult = {
|
|
338
264
|
'@context': 'https://w3id.org/did-resolution/v1',
|
|
339
265
|
didDocument,
|
|
340
|
-
didResolutionMetadata:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
266
|
+
didResolutionMetadata: {
|
|
267
|
+
...(!didDocument && { error: 'notFound' }),
|
|
268
|
+
...(Array.isArray(opts?.supportedMethods) &&
|
|
269
|
+
identifier &&
|
|
270
|
+
!opts?.supportedMethods.includes(identifier.provider.replace('did:', '')) && { error: 'unsupportedDidMethod' }),
|
|
271
|
+
},
|
|
272
|
+
didDocumentMetadata: {
|
|
273
|
+
...(identifier?.alias && { equivalentId: identifier?.alias }),
|
|
274
|
+
},
|
|
344
275
|
};
|
|
345
276
|
return resolutionResult;
|
|
346
277
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
return `did:web:${did.replace(/https?:\/\/([^/?#]+).*/i, '$1').toLowerCase()}`;
|
|
358
|
-
});
|
|
278
|
+
export async function asDidWeb(hostnameOrDID) {
|
|
279
|
+
let did = hostnameOrDID;
|
|
280
|
+
if (!did) {
|
|
281
|
+
throw Error('Domain or DID expected, but received nothing.');
|
|
282
|
+
}
|
|
283
|
+
if (did.startsWith('did:web:')) {
|
|
284
|
+
return did;
|
|
285
|
+
}
|
|
286
|
+
return `did:web:${did.replace(/https?:\/\/([^/?#]+).*/i, '$1').toLowerCase()}`;
|
|
359
287
|
}
|
|
360
|
-
exports.asDidWeb = asDidWeb;
|
|
361
288
|
//# sourceMappingURL=did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,CAAC,CAAA;KAC7D;IACD,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;QAC9B,OAAO,GAAG,CAAA;KACX;IACD,OAAO,WAAW,GAAG,CAAC,OAAO,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAA;AAChF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./did-functions"), exports);
|
|
18
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
export * from './did-functions';
|
|
2
|
+
export * from './types';
|
|
19
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA"}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk-ext.did-utils",
|
|
3
3
|
"description": "DID Utils",
|
|
4
|
-
"version": "0.13.
|
|
4
|
+
"version": "0.13.1-unstable.3+bf7e638",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
8
9
|
"scripts": {
|
|
9
10
|
"build": "tsc --build",
|
|
10
11
|
"build:clean": "tsc --build --clean && tsc --build"
|
|
11
12
|
},
|
|
12
13
|
"dependencies": {
|
|
13
14
|
"@sphereon/did-uni-client": "^0.6.0",
|
|
14
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.13.
|
|
15
|
-
"@veramo/core": "
|
|
16
|
-
"@veramo/utils": "4.
|
|
15
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.13.1-unstable.3+bf7e638",
|
|
16
|
+
"@veramo/core": "^5.3.0",
|
|
17
|
+
"@veramo/utils": "5.4.0",
|
|
17
18
|
"did-jwt": "^6.11.6",
|
|
18
19
|
"did-resolver": "^4.1.0",
|
|
19
20
|
"elliptic": "^6.5.4",
|
|
@@ -34,5 +35,5 @@
|
|
|
34
35
|
"author": "Sphereon <dev@sphereon.com>",
|
|
35
36
|
"license": "Apache-2.0",
|
|
36
37
|
"keywords": [],
|
|
37
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "bf7e63885eb9621004cd87a5804015cc5348a044"
|
|
38
39
|
}
|