@sphereon/ssi-sdk-ext.did-resolver-key 0.16.0 → 0.16.1-next.2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk-ext.did-resolver-key",
3
3
  "description": "Sphereon did:key resolver with BBS+/BLS and EBSI support.",
4
- "version": "0.16.0",
4
+ "version": "0.16.1-next.2+2f5bf1f",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "build": "tsc"
10
10
  },
11
11
  "dependencies": {
12
- "@sphereon/ssi-sdk-ext.key-utils": "^0.16.0",
12
+ "@sphereon/ssi-sdk-ext.key-utils": "^0.16.1-next.2+2f5bf1f",
13
13
  "@stablelib/ed25519": "^1.0.3",
14
14
  "bigint-mod-arith": "^3.3.1",
15
15
  "did-resolver": "^4.1.0",
@@ -51,5 +51,5 @@
51
51
  "secp256r1",
52
52
  "RSA"
53
53
  ],
54
- "gitHead": "d465181c447013c54cbd9e90daaf161acd2d41d1"
54
+ "gitHead": "2f5bf1f23f7956bc4429a5e82bda1ac167842344"
55
55
  }
@@ -216,3 +216,34 @@ exports[`Secp256r1 mapper successfully resolves the document from did:key from u
216
216
  ],
217
217
  }
218
218
  `;
219
+
220
+ exports[`Secp256r1 mapper successfully resolves the document from did:key from using JCS encoded JWK 1`] = `
221
+ {
222
+ "assertionMethod": [
223
+ "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ#zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
224
+ ],
225
+ "authentication": [
226
+ "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ#zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
227
+ ],
228
+ "capabilityDelegation": [
229
+ "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ#zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
230
+ ],
231
+ "capabilityInvocation": [
232
+ "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ#zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
233
+ ],
234
+ "id": "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
235
+ "verificationMethod": [
236
+ {
237
+ "controller": "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
238
+ "id": "did:key:zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ#zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ",
239
+ "publicKeyJwk": {
240
+ "crv": "P-256",
241
+ "kty": "EC",
242
+ "x": "-cNviWRiM3i9wGjUvOB-0XyPpIb5rAwmE8o8jDBte7Y",
243
+ "y": "HNNnF7isXk_qitI9yNB4PCMY7krXqA224AJq0LByok8",
244
+ },
245
+ "type": "JsonWebKey2020",
246
+ },
247
+ ],
248
+ }
249
+ `;
@@ -18,6 +18,18 @@ describe('Secp256r1 mapper', () => {
18
18
  expect(doc).toMatchSnapshot()
19
19
  })
20
20
 
21
+ it('successfully resolves the document from did:key from using JCS encoded JWK', async () => {
22
+ const id = 'zruuPojWkzGPb8sVc42f2YxcTXKUTpAUbdrzVovaTBmGGNyK6cGFaA4Kp7SSLKecrxYz8Sc9d77Rss7rayYt1oFCaNJ'
23
+
24
+ const multiformatPubKey = base58btc.decode(id)
25
+ varint.decode(multiformatPubKey) // decode is changing param multiformatPubKey as well
26
+ const pubKeyBytes = multiformatPubKey.slice(varint.decode.bytes)
27
+ const doc = await mapper.keyToDidDoc({ pubKeyBytes, fingerprint: id })
28
+ expect(doc).toMatchSnapshot()
29
+ })
30
+ const id =
31
+ 'did:key:zNUQqWgZZ32cgbNYngBB3tiMp1mZXKM99nCE9kx24poqWyn45ja5Kh9dKDr8JxpMu9BUqPJze3nwXrvQEeJ1f6XLpbn7ZpsA2gwAvC8wmDYWQv8Wq55ddqiepMWe3KqVZUa9sK9BddeTQcXMPdp9TNWjtLFyVMGgsRX2AeZeKiMds4nG'
32
+
21
33
  it('successfully resolves the document from did:key from raw public key #2', async () => {
22
34
  const id = 'zrusAFgBbf84b8mBz8Cmy8UoFWKV52EaeRnK86vnLo4Z5QoRypE6hXVPN2urevZMAMtcTaCDFLWBaE1Q3jmdb1FHgve'
23
35