@wireapp/core-crypto 0.6.0-rc.2 → 0.6.0-rc.4

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.
@@ -36,6 +36,15 @@ function getObject(idx) { return heap[idx]; }
36
36
 
37
37
  let heap_next = heap.length;
38
38
 
39
+ function addHeapObject(obj) {
40
+ if (heap_next === heap.length) heap.push(heap.length + 1);
41
+ const idx = heap_next;
42
+ heap_next = heap[idx];
43
+
44
+ heap[idx] = obj;
45
+ return idx;
46
+ }
47
+
39
48
  function dropObject(idx) {
40
49
  if (idx < 36) return;
41
50
  heap[idx] = heap_next;
@@ -48,15 +57,6 @@ function takeObject(idx) {
48
57
  return ret;
49
58
  }
50
59
 
51
- function addHeapObject(obj) {
52
- if (heap_next === heap.length) heap.push(heap.length + 1);
53
- const idx = heap_next;
54
- heap_next = heap[idx];
55
-
56
- heap[idx] = obj;
57
- return idx;
58
- }
59
-
60
60
  const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
61
61
 
62
62
  cachedTextDecoder.decode();
@@ -252,7 +252,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
252
252
  function __wbg_adapter_52(arg0, arg1, arg2) {
253
253
  try {
254
254
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
255
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5a2d63dc59f76e61(retptr, arg0, arg1, addHeapObject(arg2));
255
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h577395c5a39b7036(retptr, arg0, arg1, addHeapObject(arg2));
256
256
  var r0 = getInt32Memory0()[retptr / 4 + 0];
257
257
  var r1 = getInt32Memory0()[retptr / 4 + 1];
258
258
  if (r1) {
@@ -264,31 +264,7 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
264
264
  }
265
265
 
266
266
  function __wbg_adapter_55(arg0, arg1, arg2) {
267
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6d113a8418e47593(arg0, arg1, addHeapObject(arg2));
268
- }
269
-
270
- /**
271
- * Returns the current version of CoreCrypto
272
- * @returns {string}
273
- */
274
- function version() {
275
- try {
276
- const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
277
- wasm$1.version(retptr);
278
- var r0 = getInt32Memory0()[retptr / 4 + 0];
279
- var r1 = getInt32Memory0()[retptr / 4 + 1];
280
- return getStringFromWasm0(r0, r1);
281
- } finally {
282
- wasm$1.__wbindgen_add_to_stack_pointer(16);
283
- wasm$1.__wbindgen_free(r0, r1);
284
- }
285
- }
286
-
287
- function passArray8ToWasm0(arg, malloc) {
288
- const ptr = malloc(arg.length * 1);
289
- getUint8Memory0().set(arg, ptr / 1);
290
- WASM_VECTOR_LEN = arg.length;
291
- return ptr;
267
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6fecff61d3f85de1(arg0, arg1, addHeapObject(arg2));
292
268
  }
293
269
 
294
270
  function _assertClass(instance, klass) {
@@ -317,6 +293,39 @@ function passArrayJsValueToWasm0(array, malloc) {
317
293
  return ptr;
318
294
  }
319
295
 
296
+ function passArray8ToWasm0(arg, malloc) {
297
+ const ptr = malloc(arg.length * 1);
298
+ getUint8Memory0().set(arg, ptr / 1);
299
+ WASM_VECTOR_LEN = arg.length;
300
+ return ptr;
301
+ }
302
+
303
+ function getArrayJsValueFromWasm0(ptr, len) {
304
+ const mem = getUint32Memory0();
305
+ const slice = mem.subarray(ptr / 4, ptr / 4 + len);
306
+ const result = [];
307
+ for (let i = 0; i < slice.length; i++) {
308
+ result.push(takeObject(slice[i]));
309
+ }
310
+ return result;
311
+ }
312
+ /**
313
+ * Returns the current version of CoreCrypto
314
+ * @returns {string}
315
+ */
316
+ function version() {
317
+ try {
318
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
319
+ wasm$1.version(retptr);
320
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
321
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
322
+ return getStringFromWasm0(r0, r1);
323
+ } finally {
324
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
325
+ wasm$1.__wbindgen_free(r0, r1);
326
+ }
327
+ }
328
+
320
329
  function handleError(f, args) {
321
330
  try {
322
331
  return f.apply(this, args);
@@ -328,8 +337,8 @@ function handleError(f, args) {
328
337
  function getArrayU8FromWasm0(ptr, len) {
329
338
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
330
339
  }
331
- function __wbg_adapter_219(arg0, arg1, arg2, arg3) {
332
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h05b8fb12110402b0(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
340
+ function __wbg_adapter_260(arg0, arg1, arg2, arg3) {
341
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__ha446eb95921e2107(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
333
342
  }
334
343
 
335
344
  /**
@@ -377,6 +386,202 @@ MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448:6,"6":"MLS_256_DHKEMX448_CHACHA2
377
386
  */
378
387
  MLS_256_DHKEMP384_AES256GCM_SHA384_P384:7,"7":"MLS_256_DHKEMP384_AES256GCM_SHA384_P384", });
379
388
  /**
389
+ * See [core_crypto::e2e_identity::types::E2eiAcmeChallenge]
390
+ */
391
+ class AcmeChallenge {
392
+
393
+ static __wrap(ptr) {
394
+ const obj = Object.create(AcmeChallenge.prototype);
395
+ obj.ptr = ptr;
396
+
397
+ return obj;
398
+ }
399
+
400
+ __destroy_into_raw() {
401
+ const ptr = this.ptr;
402
+ this.ptr = 0;
403
+
404
+ return ptr;
405
+ }
406
+
407
+ free() {
408
+ const ptr = this.__destroy_into_raw();
409
+ wasm$1.__wbg_acmechallenge_free(ptr);
410
+ }
411
+ /**
412
+ * @param {Uint8Array} delegate
413
+ * @param {string} url
414
+ */
415
+ constructor(delegate, url) {
416
+ const ptr0 = passStringToWasm0(url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
417
+ const len0 = WASM_VECTOR_LEN;
418
+ const ret = wasm$1.acmechallenge_new(addHeapObject(delegate), ptr0, len0);
419
+ return AcmeChallenge.__wrap(ret);
420
+ }
421
+ /**
422
+ * @returns {Uint8Array}
423
+ */
424
+ get delegate() {
425
+ const ret = wasm$1.acmechallenge_delegate(this.ptr);
426
+ return takeObject(ret);
427
+ }
428
+ /**
429
+ * @returns {string}
430
+ */
431
+ get url() {
432
+ try {
433
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
434
+ wasm$1.acmechallenge_url(retptr, this.ptr);
435
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
436
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
437
+ return getStringFromWasm0(r0, r1);
438
+ } finally {
439
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
440
+ wasm$1.__wbindgen_free(r0, r1);
441
+ }
442
+ }
443
+ }
444
+ /**
445
+ * See [core_crypto::e2e_identity::types::E2eiAcmeDirectory]
446
+ */
447
+ class AcmeDirectory {
448
+
449
+ static __wrap(ptr) {
450
+ const obj = Object.create(AcmeDirectory.prototype);
451
+ obj.ptr = ptr;
452
+
453
+ return obj;
454
+ }
455
+
456
+ __destroy_into_raw() {
457
+ const ptr = this.ptr;
458
+ this.ptr = 0;
459
+
460
+ return ptr;
461
+ }
462
+
463
+ free() {
464
+ const ptr = this.__destroy_into_raw();
465
+ wasm$1.__wbg_acmedirectory_free(ptr);
466
+ }
467
+ /**
468
+ * @param {string} new_nonce
469
+ * @param {string} new_account
470
+ * @param {string} new_order
471
+ */
472
+ constructor(new_nonce, new_account, new_order) {
473
+ const ptr0 = passStringToWasm0(new_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
474
+ const len0 = WASM_VECTOR_LEN;
475
+ const ptr1 = passStringToWasm0(new_account, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
476
+ const len1 = WASM_VECTOR_LEN;
477
+ const ptr2 = passStringToWasm0(new_order, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
478
+ const len2 = WASM_VECTOR_LEN;
479
+ const ret = wasm$1.acmedirectory_new(ptr0, len0, ptr1, len1, ptr2, len2);
480
+ return AcmeDirectory.__wrap(ret);
481
+ }
482
+ /**
483
+ * @returns {string}
484
+ */
485
+ get new_nonce() {
486
+ try {
487
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
488
+ wasm$1.acmedirectory_new_nonce(retptr, this.ptr);
489
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
490
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
491
+ return getStringFromWasm0(r0, r1);
492
+ } finally {
493
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
494
+ wasm$1.__wbindgen_free(r0, r1);
495
+ }
496
+ }
497
+ /**
498
+ * @returns {string}
499
+ */
500
+ get new_account() {
501
+ try {
502
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
503
+ wasm$1.acmechallenge_url(retptr, this.ptr);
504
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
505
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
506
+ return getStringFromWasm0(r0, r1);
507
+ } finally {
508
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
509
+ wasm$1.__wbindgen_free(r0, r1);
510
+ }
511
+ }
512
+ /**
513
+ * @returns {string}
514
+ */
515
+ get new_order() {
516
+ try {
517
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
518
+ wasm$1.acmedirectory_new_order(retptr, this.ptr);
519
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
520
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
521
+ return getStringFromWasm0(r0, r1);
522
+ } finally {
523
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
524
+ wasm$1.__wbindgen_free(r0, r1);
525
+ }
526
+ }
527
+ }
528
+ /**
529
+ * See [core_crypto::e2e_identity::types::E2eiAcmeFinalize]
530
+ */
531
+ class AcmeFinalize {
532
+
533
+ static __wrap(ptr) {
534
+ const obj = Object.create(AcmeFinalize.prototype);
535
+ obj.ptr = ptr;
536
+
537
+ return obj;
538
+ }
539
+
540
+ __destroy_into_raw() {
541
+ const ptr = this.ptr;
542
+ this.ptr = 0;
543
+
544
+ return ptr;
545
+ }
546
+
547
+ free() {
548
+ const ptr = this.__destroy_into_raw();
549
+ wasm$1.__wbg_acmefinalize_free(ptr);
550
+ }
551
+ /**
552
+ * @param {Uint8Array} delegate
553
+ * @param {string} certificate_url
554
+ */
555
+ constructor(delegate, certificate_url) {
556
+ const ptr0 = passStringToWasm0(certificate_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
557
+ const len0 = WASM_VECTOR_LEN;
558
+ const ret = wasm$1.acmechallenge_new(addHeapObject(delegate), ptr0, len0);
559
+ return AcmeFinalize.__wrap(ret);
560
+ }
561
+ /**
562
+ * @returns {Uint8Array}
563
+ */
564
+ get delegate() {
565
+ const ret = wasm$1.acmechallenge_delegate(this.ptr);
566
+ return takeObject(ret);
567
+ }
568
+ /**
569
+ * @returns {string}
570
+ */
571
+ get certificate_url() {
572
+ try {
573
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
574
+ wasm$1.acmechallenge_url(retptr, this.ptr);
575
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
576
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
577
+ return getStringFromWasm0(r0, r1);
578
+ } finally {
579
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
580
+ wasm$1.__wbindgen_free(r0, r1);
581
+ }
582
+ }
583
+ }
584
+ /**
380
585
  */
381
586
  class CommitBundle {
382
587
 
@@ -1021,6 +1226,8 @@ class CoreCrypto$1 {
1021
1226
  /**
1022
1227
  * Returns: [`WasmCryptoResult<()>`]
1023
1228
  *
1229
+ * **Note**: This isn't usually needed as persisting sessions happens automatically when decrypting/encrypting messages and initializing Sessions
1230
+ *
1024
1231
  * see [core_crypto::proteus::ProteusCentral::session_save]
1025
1232
  * @param {string} session_id
1026
1233
  * @returns {Promise<any>}
@@ -1117,6 +1324,16 @@ class CoreCrypto$1 {
1117
1324
  return takeObject(ret);
1118
1325
  }
1119
1326
  /**
1327
+ * Returns: [`WasmCryptoResult<Uint8Array>`]
1328
+ *
1329
+ * see [core_crypto::proteus::ProteusCentral::new_prekey]
1330
+ * @returns {Promise<Uint8Array>}
1331
+ */
1332
+ proteus_new_prekey_auto() {
1333
+ const ret = wasm$1.corecrypto_proteus_new_prekey_auto(this.ptr);
1334
+ return takeObject(ret);
1335
+ }
1336
+ /**
1120
1337
  * Returns: [`WasmCryptoResult<String>`]
1121
1338
  *
1122
1339
  * see [core_crypto::proteus::ProteusCentral::fingerprint]
@@ -1221,6 +1438,15 @@ class CoreCrypto$1 {
1221
1438
  const ret = wasm$1.corecrypto_get_client_ids(this.ptr, ptr0, len0);
1222
1439
  return takeObject(ret);
1223
1440
  }
1441
+ /**
1442
+ * see [core_crypto::MlsCentral::new_acme_enrollment]
1443
+ * @param {number} ciphersuite
1444
+ * @returns {Promise<WireE2eIdentity>}
1445
+ */
1446
+ new_acme_enrollment(ciphersuite) {
1447
+ const ret = wasm$1.corecrypto_new_acme_enrollment(this.ptr, ciphersuite);
1448
+ return takeObject(ret);
1449
+ }
1224
1450
  }
1225
1451
  /**
1226
1452
  * see [core_crypto::prelude::CoreCryptoCallbacks]
@@ -1457,11 +1683,12 @@ class MemberAddedMessages {
1457
1683
  }
1458
1684
  }
1459
1685
  /**
1686
+ * See [core_crypto::e2e_identity::types::E2eiNewAcmeAuthz]
1460
1687
  */
1461
- class ProposalBundle {
1688
+ class NewAcmeAuthz {
1462
1689
 
1463
1690
  static __wrap(ptr) {
1464
- const obj = Object.create(ProposalBundle.prototype);
1691
+ const obj = Object.create(NewAcmeAuthz.prototype);
1465
1692
  obj.ptr = ptr;
1466
1693
 
1467
1694
  return obj;
@@ -1476,29 +1703,68 @@ class ProposalBundle {
1476
1703
 
1477
1704
  free() {
1478
1705
  const ptr = this.__destroy_into_raw();
1479
- wasm$1.__wbg_proposalbundle_free(ptr);
1706
+ wasm$1.__wbg_newacmeauthz_free(ptr);
1480
1707
  }
1481
1708
  /**
1482
- * @returns {Uint8Array}
1709
+ * @param {string} identifier
1710
+ * @param {AcmeChallenge | undefined} wire_http_challenge
1711
+ * @param {AcmeChallenge | undefined} wire_oidc_challenge
1483
1712
  */
1484
- get proposal() {
1485
- const ret = wasm$1.commitbundle_commit(this.ptr);
1486
- return takeObject(ret);
1713
+ constructor(identifier, wire_http_challenge, wire_oidc_challenge) {
1714
+ const ptr0 = passStringToWasm0(identifier, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1715
+ const len0 = WASM_VECTOR_LEN;
1716
+ let ptr1 = 0;
1717
+ if (!isLikeNone(wire_http_challenge)) {
1718
+ _assertClass(wire_http_challenge, AcmeChallenge);
1719
+ ptr1 = wire_http_challenge.ptr;
1720
+ wire_http_challenge.ptr = 0;
1721
+ }
1722
+ let ptr2 = 0;
1723
+ if (!isLikeNone(wire_oidc_challenge)) {
1724
+ _assertClass(wire_oidc_challenge, AcmeChallenge);
1725
+ ptr2 = wire_oidc_challenge.ptr;
1726
+ wire_oidc_challenge.ptr = 0;
1727
+ }
1728
+ const ret = wasm$1.newacmeauthz_new(ptr0, len0, ptr1, ptr2);
1729
+ return NewAcmeAuthz.__wrap(ret);
1487
1730
  }
1488
1731
  /**
1489
- * @returns {Uint8Array}
1732
+ * @returns {string}
1490
1733
  */
1491
- get proposal_ref() {
1492
- const ret = wasm$1.conversationinitbundle_commit(this.ptr);
1493
- return takeObject(ret);
1734
+ get identifier() {
1735
+ try {
1736
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1737
+ wasm$1.acmedirectory_new_nonce(retptr, this.ptr);
1738
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1739
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1740
+ return getStringFromWasm0(r0, r1);
1741
+ } finally {
1742
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
1743
+ wasm$1.__wbindgen_free(r0, r1);
1744
+ }
1745
+ }
1746
+ /**
1747
+ * @returns {AcmeChallenge | undefined}
1748
+ */
1749
+ get wire_http_challenge() {
1750
+ const ret = wasm$1.newacmeauthz_wire_http_challenge(this.ptr);
1751
+ return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
1752
+ }
1753
+ /**
1754
+ * @returns {AcmeChallenge | undefined}
1755
+ */
1756
+ get wire_oidc_challenge() {
1757
+ const ret = wasm$1.newacmeauthz_wire_oidc_challenge(this.ptr);
1758
+ return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
1494
1759
  }
1495
1760
  }
1496
1761
  /**
1762
+ * See [core_crypto::e2e_identity::types::E2eiNewAcmeOrder]
1497
1763
  */
1498
- class PublicGroupStateBundle {
1764
+ class NewAcmeOrder {
1499
1765
 
1500
1766
  static __wrap(ptr) {
1501
- const obj = Object.create(PublicGroupStateBundle.prototype);
1767
+ const obj = Object.create(NewAcmeOrder.prototype);
1502
1768
  obj.ptr = ptr;
1503
1769
 
1504
1770
  return obj;
@@ -1513,14 +1779,98 @@ class PublicGroupStateBundle {
1513
1779
 
1514
1780
  free() {
1515
1781
  const ptr = this.__destroy_into_raw();
1516
- wasm$1.__wbg_publicgroupstatebundle_free(ptr);
1782
+ wasm$1.__wbg_newacmeorder_free(ptr);
1517
1783
  }
1518
1784
  /**
1519
- * @returns {number}
1785
+ * @param {Uint8Array} delegate
1786
+ * @param {(Uint8Array)[]} authorizations
1520
1787
  */
1521
- get encryption_type() {
1522
- const ret = wasm$1.publicgroupstatebundle_encryption_type(this.ptr);
1523
- return ret;
1788
+ constructor(delegate, authorizations) {
1789
+ const ptr0 = passArrayJsValueToWasm0(authorizations, wasm$1.__wbindgen_malloc);
1790
+ const len0 = WASM_VECTOR_LEN;
1791
+ const ret = wasm$1.newacmeorder_new(addHeapObject(delegate), ptr0, len0);
1792
+ return NewAcmeOrder.__wrap(ret);
1793
+ }
1794
+ /**
1795
+ * @returns {Uint8Array}
1796
+ */
1797
+ get delegate() {
1798
+ const ret = wasm$1.acmechallenge_delegate(this.ptr);
1799
+ return takeObject(ret);
1800
+ }
1801
+ /**
1802
+ * @returns {Array<any>}
1803
+ */
1804
+ get authorizations() {
1805
+ const ret = wasm$1.newacmeorder_authorizations(this.ptr);
1806
+ return takeObject(ret);
1807
+ }
1808
+ }
1809
+ /**
1810
+ */
1811
+ class ProposalBundle {
1812
+
1813
+ static __wrap(ptr) {
1814
+ const obj = Object.create(ProposalBundle.prototype);
1815
+ obj.ptr = ptr;
1816
+
1817
+ return obj;
1818
+ }
1819
+
1820
+ __destroy_into_raw() {
1821
+ const ptr = this.ptr;
1822
+ this.ptr = 0;
1823
+
1824
+ return ptr;
1825
+ }
1826
+
1827
+ free() {
1828
+ const ptr = this.__destroy_into_raw();
1829
+ wasm$1.__wbg_proposalbundle_free(ptr);
1830
+ }
1831
+ /**
1832
+ * @returns {Uint8Array}
1833
+ */
1834
+ get proposal() {
1835
+ const ret = wasm$1.commitbundle_commit(this.ptr);
1836
+ return takeObject(ret);
1837
+ }
1838
+ /**
1839
+ * @returns {Uint8Array}
1840
+ */
1841
+ get proposal_ref() {
1842
+ const ret = wasm$1.conversationinitbundle_commit(this.ptr);
1843
+ return takeObject(ret);
1844
+ }
1845
+ }
1846
+ /**
1847
+ */
1848
+ class PublicGroupStateBundle {
1849
+
1850
+ static __wrap(ptr) {
1851
+ const obj = Object.create(PublicGroupStateBundle.prototype);
1852
+ obj.ptr = ptr;
1853
+
1854
+ return obj;
1855
+ }
1856
+
1857
+ __destroy_into_raw() {
1858
+ const ptr = this.ptr;
1859
+ this.ptr = 0;
1860
+
1861
+ return ptr;
1862
+ }
1863
+
1864
+ free() {
1865
+ const ptr = this.__destroy_into_raw();
1866
+ wasm$1.__wbg_publicgroupstatebundle_free(ptr);
1867
+ }
1868
+ /**
1869
+ * @returns {number}
1870
+ */
1871
+ get encryption_type() {
1872
+ const ret = wasm$1.publicgroupstatebundle_encryption_type(this.ptr);
1873
+ return ret;
1524
1874
  }
1525
1875
  /**
1526
1876
  * @returns {number}
@@ -1532,9 +1882,416 @@ class PublicGroupStateBundle {
1532
1882
  /**
1533
1883
  * @returns {Uint8Array}
1534
1884
  */
1535
- get payload() {
1536
- const ret = wasm$1.commitbundle_commit(this.ptr);
1537
- return takeObject(ret);
1885
+ get payload() {
1886
+ const ret = wasm$1.commitbundle_commit(this.ptr);
1887
+ return takeObject(ret);
1888
+ }
1889
+ }
1890
+ /**
1891
+ */
1892
+ class WireE2eIdentity$1 {
1893
+
1894
+ static __wrap(ptr) {
1895
+ const obj = Object.create(WireE2eIdentity$1.prototype);
1896
+ obj.ptr = ptr;
1897
+
1898
+ return obj;
1899
+ }
1900
+
1901
+ __destroy_into_raw() {
1902
+ const ptr = this.ptr;
1903
+ this.ptr = 0;
1904
+
1905
+ return ptr;
1906
+ }
1907
+
1908
+ free() {
1909
+ const ptr = this.__destroy_into_raw();
1910
+ wasm$1.__wbg_wiree2eidentity_free(ptr);
1911
+ }
1912
+ /**
1913
+ * See [core_crypto::e2e_identity::WireE2eIdentity::directory_response]
1914
+ * @param {Uint8Array} directory
1915
+ * @returns {any}
1916
+ */
1917
+ directory_response(directory) {
1918
+ try {
1919
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1920
+ const ptr0 = passArray8ToWasm0(directory, wasm$1.__wbindgen_malloc);
1921
+ const len0 = WASM_VECTOR_LEN;
1922
+ wasm$1.wiree2eidentity_directory_response(retptr, this.ptr, ptr0, len0);
1923
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1924
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1925
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
1926
+ if (r2) {
1927
+ throw takeObject(r1);
1928
+ }
1929
+ return takeObject(r0);
1930
+ } finally {
1931
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
1932
+ }
1933
+ }
1934
+ /**
1935
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_account_request]
1936
+ * @param {any} directory
1937
+ * @param {string} previous_nonce
1938
+ * @returns {Uint8Array}
1939
+ */
1940
+ new_account_request(directory, previous_nonce) {
1941
+ try {
1942
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1943
+ const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1944
+ const len0 = WASM_VECTOR_LEN;
1945
+ wasm$1.wiree2eidentity_new_account_request(retptr, this.ptr, addHeapObject(directory), ptr0, len0);
1946
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1947
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1948
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
1949
+ if (r2) {
1950
+ throw takeObject(r1);
1951
+ }
1952
+ return takeObject(r0);
1953
+ } finally {
1954
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
1955
+ }
1956
+ }
1957
+ /**
1958
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_account_response]
1959
+ * @param {Uint8Array} account
1960
+ * @returns {Uint8Array}
1961
+ */
1962
+ new_account_response(account) {
1963
+ try {
1964
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1965
+ wasm$1.wiree2eidentity_new_account_response(retptr, this.ptr, addHeapObject(account));
1966
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1967
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1968
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
1969
+ if (r2) {
1970
+ throw takeObject(r1);
1971
+ }
1972
+ return takeObject(r0);
1973
+ } finally {
1974
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
1975
+ }
1976
+ }
1977
+ /**
1978
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_order_request]
1979
+ * @param {string} handle
1980
+ * @param {string} client_id
1981
+ * @param {number} expiry_days
1982
+ * @param {any} directory
1983
+ * @param {Uint8Array} account
1984
+ * @param {string} previous_nonce
1985
+ * @returns {Uint8Array}
1986
+ */
1987
+ new_order_request(handle, client_id, expiry_days, directory, account, previous_nonce) {
1988
+ try {
1989
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1990
+ const ptr0 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1991
+ const len0 = WASM_VECTOR_LEN;
1992
+ const ptr1 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1993
+ const len1 = WASM_VECTOR_LEN;
1994
+ const ptr2 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1995
+ const len2 = WASM_VECTOR_LEN;
1996
+ wasm$1.wiree2eidentity_new_order_request(retptr, this.ptr, ptr0, len0, ptr1, len1, expiry_days, addHeapObject(directory), addHeapObject(account), ptr2, len2);
1997
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
1998
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
1999
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2000
+ if (r2) {
2001
+ throw takeObject(r1);
2002
+ }
2003
+ return takeObject(r0);
2004
+ } finally {
2005
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2006
+ }
2007
+ }
2008
+ /**
2009
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_order_response]
2010
+ * @param {Uint8Array} order
2011
+ * @returns {any}
2012
+ */
2013
+ new_order_response(order) {
2014
+ try {
2015
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2016
+ wasm$1.wiree2eidentity_new_order_response(retptr, this.ptr, addHeapObject(order));
2017
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2018
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2019
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2020
+ if (r2) {
2021
+ throw takeObject(r1);
2022
+ }
2023
+ return takeObject(r0);
2024
+ } finally {
2025
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2026
+ }
2027
+ }
2028
+ /**
2029
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_authz_request]
2030
+ * @param {string} url
2031
+ * @param {Uint8Array} account
2032
+ * @param {string} previous_nonce
2033
+ * @returns {Uint8Array}
2034
+ */
2035
+ new_authz_request(url, account, previous_nonce) {
2036
+ try {
2037
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2038
+ const ptr0 = passStringToWasm0(url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2039
+ const len0 = WASM_VECTOR_LEN;
2040
+ const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2041
+ const len1 = WASM_VECTOR_LEN;
2042
+ wasm$1.wiree2eidentity_new_authz_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
2043
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2044
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2045
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2046
+ if (r2) {
2047
+ throw takeObject(r1);
2048
+ }
2049
+ return takeObject(r0);
2050
+ } finally {
2051
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2052
+ }
2053
+ }
2054
+ /**
2055
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_authz_response]
2056
+ * @param {Uint8Array} authz
2057
+ * @returns {any}
2058
+ */
2059
+ new_authz_response(authz) {
2060
+ try {
2061
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2062
+ wasm$1.wiree2eidentity_new_authz_response(retptr, this.ptr, addHeapObject(authz));
2063
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2064
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2065
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2066
+ if (r2) {
2067
+ throw takeObject(r1);
2068
+ }
2069
+ return takeObject(r0);
2070
+ } finally {
2071
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2072
+ }
2073
+ }
2074
+ /**
2075
+ * See [core_crypto::e2e_identity::WireE2eIdentity::create_dpop_token]
2076
+ * @param {string} access_token_url
2077
+ * @param {string} user_id
2078
+ * @param {bigint} client_id
2079
+ * @param {string} domain
2080
+ * @param {any} client_id_challenge
2081
+ * @param {string} backend_nonce
2082
+ * @param {number} expiry_days
2083
+ * @returns {string}
2084
+ */
2085
+ create_dpop_token(access_token_url, user_id, client_id, domain, client_id_challenge, backend_nonce, expiry_days) {
2086
+ try {
2087
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2088
+ const ptr0 = passStringToWasm0(access_token_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2089
+ const len0 = WASM_VECTOR_LEN;
2090
+ const ptr1 = passStringToWasm0(user_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2091
+ const len1 = WASM_VECTOR_LEN;
2092
+ const ptr2 = passStringToWasm0(domain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2093
+ const len2 = WASM_VECTOR_LEN;
2094
+ const ptr3 = passStringToWasm0(backend_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2095
+ const len3 = WASM_VECTOR_LEN;
2096
+ wasm$1.wiree2eidentity_create_dpop_token(retptr, this.ptr, ptr0, len0, ptr1, len1, client_id, ptr2, len2, addHeapObject(client_id_challenge), ptr3, len3, expiry_days);
2097
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2098
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2099
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2100
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
2101
+ var ptr4 = r0;
2102
+ var len4 = r1;
2103
+ if (r3) {
2104
+ ptr4 = 0; len4 = 0;
2105
+ throw takeObject(r2);
2106
+ }
2107
+ return getStringFromWasm0(ptr4, len4);
2108
+ } finally {
2109
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2110
+ wasm$1.__wbindgen_free(ptr4, len4);
2111
+ }
2112
+ }
2113
+ /**
2114
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_challenge_request]
2115
+ * @param {any} handle_challenge
2116
+ * @param {Uint8Array} account
2117
+ * @param {string} previous_nonce
2118
+ * @returns {Uint8Array}
2119
+ */
2120
+ new_challenge_request(handle_challenge, account, previous_nonce) {
2121
+ try {
2122
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2123
+ const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2124
+ const len0 = WASM_VECTOR_LEN;
2125
+ wasm$1.wiree2eidentity_new_challenge_request(retptr, this.ptr, addHeapObject(handle_challenge), addHeapObject(account), ptr0, len0);
2126
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2127
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2128
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2129
+ if (r2) {
2130
+ throw takeObject(r1);
2131
+ }
2132
+ return takeObject(r0);
2133
+ } finally {
2134
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2135
+ }
2136
+ }
2137
+ /**
2138
+ * See [core_crypto::e2e_identity::WireE2eIdentity::new_challenge_response]
2139
+ * @param {Uint8Array} challenge
2140
+ */
2141
+ new_challenge_response(challenge) {
2142
+ try {
2143
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2144
+ wasm$1.wiree2eidentity_new_challenge_response(retptr, this.ptr, addHeapObject(challenge));
2145
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2146
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2147
+ if (r1) {
2148
+ throw takeObject(r0);
2149
+ }
2150
+ } finally {
2151
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2152
+ }
2153
+ }
2154
+ /**
2155
+ * See [core_crypto::e2e_identity::WireE2eIdentity::check_order_request]
2156
+ * @param {string} order_url
2157
+ * @param {Uint8Array} account
2158
+ * @param {string} previous_nonce
2159
+ * @returns {Uint8Array}
2160
+ */
2161
+ check_order_request(order_url, account, previous_nonce) {
2162
+ try {
2163
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2164
+ const ptr0 = passStringToWasm0(order_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2165
+ const len0 = WASM_VECTOR_LEN;
2166
+ const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2167
+ const len1 = WASM_VECTOR_LEN;
2168
+ wasm$1.wiree2eidentity_check_order_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
2169
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2170
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2171
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2172
+ if (r2) {
2173
+ throw takeObject(r1);
2174
+ }
2175
+ return takeObject(r0);
2176
+ } finally {
2177
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2178
+ }
2179
+ }
2180
+ /**
2181
+ * See [core_crypto::e2e_identity::WireE2eIdentity::check_order_response]
2182
+ * @param {Uint8Array} order
2183
+ * @returns {Uint8Array}
2184
+ */
2185
+ check_order_response(order) {
2186
+ try {
2187
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2188
+ wasm$1.wiree2eidentity_check_order_response(retptr, this.ptr, addHeapObject(order));
2189
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2190
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2191
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2192
+ if (r2) {
2193
+ throw takeObject(r1);
2194
+ }
2195
+ return takeObject(r0);
2196
+ } finally {
2197
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2198
+ }
2199
+ }
2200
+ /**
2201
+ * See [core_crypto::e2e_identity::WireE2eIdentity::finalize_request]
2202
+ * @param {(Uint8Array)[]} domains
2203
+ * @param {Uint8Array} order
2204
+ * @param {Uint8Array} account
2205
+ * @param {string} previous_nonce
2206
+ * @returns {Uint8Array}
2207
+ */
2208
+ finalize_request(domains, order, account, previous_nonce) {
2209
+ try {
2210
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2211
+ const ptr0 = passArrayJsValueToWasm0(domains, wasm$1.__wbindgen_malloc);
2212
+ const len0 = WASM_VECTOR_LEN;
2213
+ const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2214
+ const len1 = WASM_VECTOR_LEN;
2215
+ wasm$1.wiree2eidentity_finalize_request(retptr, this.ptr, ptr0, len0, addHeapObject(order), addHeapObject(account), ptr1, len1);
2216
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2217
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2218
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2219
+ if (r2) {
2220
+ throw takeObject(r1);
2221
+ }
2222
+ return takeObject(r0);
2223
+ } finally {
2224
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2225
+ }
2226
+ }
2227
+ /**
2228
+ * See [core_crypto::e2e_identity::WireE2eIdentity::finalize_response]
2229
+ * @param {Uint8Array} finalize
2230
+ * @returns {any}
2231
+ */
2232
+ finalize_response(finalize) {
2233
+ try {
2234
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2235
+ wasm$1.wiree2eidentity_finalize_response(retptr, this.ptr, addHeapObject(finalize));
2236
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2237
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2238
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2239
+ if (r2) {
2240
+ throw takeObject(r1);
2241
+ }
2242
+ return takeObject(r0);
2243
+ } finally {
2244
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2245
+ }
2246
+ }
2247
+ /**
2248
+ * See [core_crypto::e2e_identity::WireE2eIdentity::certificate_request]
2249
+ * @param {any} finalize
2250
+ * @param {Uint8Array} account
2251
+ * @param {string} previous_nonce
2252
+ * @returns {Uint8Array}
2253
+ */
2254
+ certificate_request(finalize, account, previous_nonce) {
2255
+ try {
2256
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2257
+ const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2258
+ const len0 = WASM_VECTOR_LEN;
2259
+ wasm$1.wiree2eidentity_certificate_request(retptr, this.ptr, addHeapObject(finalize), addHeapObject(account), ptr0, len0);
2260
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2261
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2262
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2263
+ if (r2) {
2264
+ throw takeObject(r1);
2265
+ }
2266
+ return takeObject(r0);
2267
+ } finally {
2268
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2269
+ }
2270
+ }
2271
+ /**
2272
+ * See [core_crypto::e2e_identity::WireE2eIdentity::certificate_response]
2273
+ * @param {string} certificate_chain
2274
+ * @returns {(Uint8Array)[]}
2275
+ */
2276
+ certificate_response(certificate_chain) {
2277
+ try {
2278
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2279
+ const ptr0 = passStringToWasm0(certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2280
+ const len0 = WASM_VECTOR_LEN;
2281
+ wasm$1.wiree2eidentity_certificate_response(retptr, this.ptr, ptr0, len0);
2282
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2283
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2284
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
2285
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
2286
+ if (r3) {
2287
+ throw takeObject(r2);
2288
+ }
2289
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2290
+ wasm$1.__wbindgen_free(r0, r1 * 4);
2291
+ return v1;
2292
+ } finally {
2293
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2294
+ }
1538
2295
  }
1539
2296
  }
1540
2297
 
@@ -1572,13 +2329,13 @@ async function load(module, imports) {
1572
2329
  function getImports() {
1573
2330
  const imports = {};
1574
2331
  imports.wbg = {};
1575
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
1576
- takeObject(arg0);
1577
- };
1578
2332
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
1579
2333
  const ret = getObject(arg0);
1580
2334
  return addHeapObject(ret);
1581
2335
  };
2336
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
2337
+ takeObject(arg0);
2338
+ };
1582
2339
  imports.wbg.__wbindgen_is_object = function(arg0) {
1583
2340
  const val = getObject(arg0);
1584
2341
  const ret = typeof(val) === 'object' && val !== null;
@@ -1689,15 +2446,19 @@ function getImports() {
1689
2446
  const ret = CoreCrypto$1.__wrap(arg0);
1690
2447
  return addHeapObject(ret);
1691
2448
  };
1692
- imports.wbg.__wbindgen_number_new = function(arg0) {
1693
- const ret = arg0;
2449
+ imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
2450
+ const ret = new Object();
1694
2451
  return addHeapObject(ret);
1695
2452
  };
1696
2453
  imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
1697
2454
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
1698
2455
  };
1699
- imports.wbg.__wbg_new_0b9bfdd97583284e = function() {
1700
- const ret = new Object();
2456
+ imports.wbg.__wbindgen_number_new = function(arg0) {
2457
+ const ret = arg0;
2458
+ return addHeapObject(ret);
2459
+ };
2460
+ imports.wbg.__wbg_wiree2eidentity_new = function(arg0) {
2461
+ const ret = WireE2eIdentity$1.__wrap(arg0);
1701
2462
  return addHeapObject(ret);
1702
2463
  };
1703
2464
  imports.wbg.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
@@ -1708,22 +2469,6 @@ function getImports() {
1708
2469
  const ret = new Uint8Array(getObject(arg0));
1709
2470
  return addHeapObject(ret);
1710
2471
  };
1711
- imports.wbg.__wbg_new_268f7b7dd3430798 = function() {
1712
- const ret = new Map();
1713
- return addHeapObject(ret);
1714
- };
1715
- imports.wbg.__wbg_set_933729cf5b66ac11 = function(arg0, arg1, arg2) {
1716
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
1717
- return addHeapObject(ret);
1718
- };
1719
- imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
1720
- const ret = new Array();
1721
- return addHeapObject(ret);
1722
- };
1723
- imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
1724
- const ret = getObject(arg0).push(getObject(arg1));
1725
- return ret;
1726
- };
1727
2472
  imports.wbg.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
1728
2473
  try {
1729
2474
  var state0 = {a: arg0, b: arg1};
@@ -1731,7 +2476,7 @@ function getImports() {
1731
2476
  const a = state0.a;
1732
2477
  state0.a = 0;
1733
2478
  try {
1734
- return __wbg_adapter_219(a, state0.b, arg0, arg1);
2479
+ return __wbg_adapter_260(a, state0.b, arg0, arg1);
1735
2480
  } finally {
1736
2481
  state0.a = a;
1737
2482
  }
@@ -1742,6 +2487,22 @@ function getImports() {
1742
2487
  state0.a = state0.b = 0;
1743
2488
  }
1744
2489
  };
2490
+ imports.wbg.__wbg_new_1d9a920c6bfc44a8 = function() {
2491
+ const ret = new Array();
2492
+ return addHeapObject(ret);
2493
+ };
2494
+ imports.wbg.__wbg_push_740e4b286702d964 = function(arg0, arg1) {
2495
+ const ret = getObject(arg0).push(getObject(arg1));
2496
+ return ret;
2497
+ };
2498
+ imports.wbg.__wbg_new_268f7b7dd3430798 = function() {
2499
+ const ret = new Map();
2500
+ return addHeapObject(ret);
2501
+ };
2502
+ imports.wbg.__wbg_set_933729cf5b66ac11 = function(arg0, arg1, arg2) {
2503
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2504
+ return addHeapObject(ret);
2505
+ };
1745
2506
  imports.wbg.__wbg_set_a68214f35c417fa9 = function(arg0, arg1, arg2) {
1746
2507
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
1747
2508
  };
@@ -1761,6 +2522,14 @@ function getImports() {
1761
2522
  const ret = ProposalBundle.__wrap(arg0);
1762
2523
  return addHeapObject(ret);
1763
2524
  };
2525
+ imports.wbg.__wbg_now_4d4a1d65c7a8c0ba = function() {
2526
+ const ret = Date.now();
2527
+ return ret;
2528
+ };
2529
+ imports.wbg.__wbg_now_78244d2ced74c026 = function() {
2530
+ const ret = performance.now();
2531
+ return ret;
2532
+ };
1764
2533
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
1765
2534
  const ret = new Error();
1766
2535
  return addHeapObject(ret);
@@ -1812,21 +2581,6 @@ function getImports() {
1812
2581
  const ret = false;
1813
2582
  return ret;
1814
2583
  };
1815
- imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
1816
- getObject(arg0).onsuccess = getObject(arg1);
1817
- };
1818
- imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
1819
- const ret = getObject(arg0).delete(getObject(arg1));
1820
- return addHeapObject(ret);
1821
- }, arguments) };
1822
- imports.wbg.__wbg_put_84e7fc93eee27b28 = function() { return handleError(function (arg0, arg1, arg2) {
1823
- const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
1824
- return addHeapObject(ret);
1825
- }, arguments) };
1826
- imports.wbg.__wbg_put_f2763b05a07f3233 = function() { return handleError(function (arg0, arg1) {
1827
- const ret = getObject(arg0).put(getObject(arg1));
1828
- return addHeapObject(ret);
1829
- }, arguments) };
1830
2584
  imports.wbg.__wbg_openCursor_e036069f0e326708 = function() { return handleError(function (arg0, arg1) {
1831
2585
  const ret = getObject(arg0).openCursor(getObject(arg1));
1832
2586
  return addHeapObject(ret);
@@ -1835,20 +2589,16 @@ function getImports() {
1835
2589
  const ret = getObject(arg0).openCursor();
1836
2590
  return addHeapObject(ret);
1837
2591
  }, arguments) };
1838
- imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
1839
- const ret = getObject(arg0).get(getObject(arg1));
1840
- return addHeapObject(ret);
1841
- }, arguments) };
1842
- imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
1843
- const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1844
- return addHeapObject(ret);
1845
- }, arguments) };
1846
- imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
1847
- getObject(arg0).close();
2592
+ imports.wbg.__wbg_setonsuccess_5f71593bc51653a3 = function(arg0, arg1) {
2593
+ getObject(arg0).onsuccess = getObject(arg1);
1848
2594
  };
1849
2595
  imports.wbg.__wbg_setonerror_d5771cc5bf9ea74c = function(arg0, arg1) {
1850
2596
  getObject(arg0).onerror = getObject(arg1);
1851
2597
  };
2598
+ imports.wbg.__wbg_get_6285bf458a1ee758 = function() { return handleError(function (arg0, arg1) {
2599
+ const ret = getObject(arg0).get(getObject(arg1));
2600
+ return addHeapObject(ret);
2601
+ }, arguments) };
1852
2602
  imports.wbg.__wbg_count_b0e88953a0ea909c = function() { return handleError(function (arg0) {
1853
2603
  const ret = getObject(arg0).count();
1854
2604
  return addHeapObject(ret);
@@ -1857,6 +2607,29 @@ function getImports() {
1857
2607
  const ret = getObject(arg0).count(getObject(arg1));
1858
2608
  return addHeapObject(ret);
1859
2609
  }, arguments) };
2610
+ imports.wbg.__wbg_delete_8abedd1043b4105d = function() { return handleError(function (arg0, arg1) {
2611
+ const ret = getObject(arg0).delete(getObject(arg1));
2612
+ return addHeapObject(ret);
2613
+ }, arguments) };
2614
+ imports.wbg.__wbg_put_84e7fc93eee27b28 = function() { return handleError(function (arg0, arg1, arg2) {
2615
+ const ret = getObject(arg0).put(getObject(arg1), getObject(arg2));
2616
+ return addHeapObject(ret);
2617
+ }, arguments) };
2618
+ imports.wbg.__wbg_put_f2763b05a07f3233 = function() { return handleError(function (arg0, arg1) {
2619
+ const ret = getObject(arg0).put(getObject(arg1));
2620
+ return addHeapObject(ret);
2621
+ }, arguments) };
2622
+ imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
2623
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
2624
+ return addHeapObject(ret);
2625
+ }, arguments) };
2626
+ imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
2627
+ const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
2628
+ return addHeapObject(ret);
2629
+ }, arguments) };
2630
+ imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
2631
+ getObject(arg0).onupgradeneeded = getObject(arg1);
2632
+ };
1860
2633
  imports.wbg.__wbg_index_86861edf1478f49c = function() { return handleError(function (arg0, arg1, arg2) {
1861
2634
  const ret = getObject(arg0).index(getStringFromWasm0(arg1, arg2));
1862
2635
  return addHeapObject(ret);
@@ -1877,16 +2650,12 @@ function getImports() {
1877
2650
  const ret = getObject(arg0).openCursor(getObject(arg1));
1878
2651
  return addHeapObject(ret);
1879
2652
  }, arguments) };
1880
- imports.wbg.__wbg_open_a31c3fe1fdc244eb = function() { return handleError(function (arg0, arg1, arg2) {
1881
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2));
1882
- return addHeapObject(ret);
1883
- }, arguments) };
1884
- imports.wbg.__wbg_open_c5d5fb2df44b9d10 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
1885
- const ret = getObject(arg0).open(getStringFromWasm0(arg1, arg2), arg3 >>> 0);
2653
+ imports.wbg.__wbg_deleteDatabase_f6454de6a88aebde = function() { return handleError(function (arg0, arg1, arg2) {
2654
+ const ret = getObject(arg0).deleteDatabase(getStringFromWasm0(arg1, arg2));
1886
2655
  return addHeapObject(ret);
1887
2656
  }, arguments) };
1888
- imports.wbg.__wbg_setonupgradeneeded_17d0b9530f1e0cac = function(arg0, arg1) {
1889
- getObject(arg0).onupgradeneeded = getObject(arg1);
2657
+ imports.wbg.__wbg_close_5a04b9ce11dade22 = function(arg0) {
2658
+ getObject(arg0).close();
1890
2659
  };
1891
2660
  imports.wbg.__wbg_randomFillSync_6894564c2c334c42 = function() { return handleError(function (arg0, arg1, arg2) {
1892
2661
  getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
@@ -2009,10 +2778,6 @@ function getImports() {
2009
2778
  const ret = getObject(arg0).result;
2010
2779
  return addHeapObject(ret);
2011
2780
  }, arguments) };
2012
- imports.wbg.__wbg_error_aacf5ac191e54ed0 = function() { return handleError(function (arg0) {
2013
- const ret = getObject(arg0).error;
2014
- return isLikeNone(ret) ? 0 : addHeapObject(ret);
2015
- }, arguments) };
2016
2781
  imports.wbg.__wbg_contains_6cf516181cd86571 = function(arg0, arg1, arg2) {
2017
2782
  const ret = getObject(arg0).contains(getStringFromWasm0(arg1, arg2));
2018
2783
  return ret;
@@ -2039,6 +2804,10 @@ function getImports() {
2039
2804
  imports.wbg.__wbg_deleteObjectStore_1b698c5fd1bc077d = function() { return handleError(function (arg0, arg1, arg2) {
2040
2805
  getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
2041
2806
  }, arguments) };
2807
+ imports.wbg.__wbg_error_aacf5ac191e54ed0 = function() { return handleError(function (arg0) {
2808
+ const ret = getObject(arg0).error;
2809
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2810
+ }, arguments) };
2042
2811
  imports.wbg.__wbindgen_is_falsy = function(arg0) {
2043
2812
  const ret = !getObject(arg0);
2044
2813
  return ret;
@@ -2064,6 +2833,24 @@ function getImports() {
2064
2833
  const ret = getObject(arg0).toString();
2065
2834
  return addHeapObject(ret);
2066
2835
  };
2836
+ imports.wbg.__wbg_instanceof_Window_acc97ff9f5d2c7b4 = function(arg0) {
2837
+ let result;
2838
+ try {
2839
+ result = getObject(arg0) instanceof Window;
2840
+ } catch {
2841
+ result = false;
2842
+ }
2843
+ const ret = result;
2844
+ return ret;
2845
+ };
2846
+ imports.wbg.__wbg_crypto_9f07beb1e97bfa1b = function() { return handleError(function (arg0) {
2847
+ const ret = getObject(arg0).crypto;
2848
+ return addHeapObject(ret);
2849
+ }, arguments) };
2850
+ imports.wbg.__wbg_getRandomValues_f134f772d240c51f = function() { return handleError(function (arg0, arg1, arg2) {
2851
+ const ret = getObject(arg0).getRandomValues(getArrayU8FromWasm0(arg1, arg2));
2852
+ return addHeapObject(ret);
2853
+ }, arguments) };
2067
2854
  imports.wbg.__wbg_instanceof_Uint8Array_971eeda69eb75003 = function(arg0) {
2068
2855
  let result;
2069
2856
  try {
@@ -2139,12 +2926,12 @@ function getImports() {
2139
2926
  const ret = getObject(arg0).objectStore(getStringFromWasm0(arg1, arg2));
2140
2927
  return addHeapObject(ret);
2141
2928
  }, arguments) };
2142
- imports.wbg.__wbindgen_closure_wrapper2357 = function(arg0, arg1, arg2) {
2143
- const ret = makeMutClosure(arg0, arg1, 122, __wbg_adapter_52);
2929
+ imports.wbg.__wbindgen_closure_wrapper2639 = function(arg0, arg1, arg2) {
2930
+ const ret = makeMutClosure(arg0, arg1, 142, __wbg_adapter_52);
2144
2931
  return addHeapObject(ret);
2145
2932
  };
2146
- imports.wbg.__wbindgen_closure_wrapper3837 = function(arg0, arg1, arg2) {
2147
- const ret = makeMutClosure(arg0, arg1, 122, __wbg_adapter_55);
2933
+ imports.wbg.__wbindgen_closure_wrapper4541 = function(arg0, arg1, arg2) {
2934
+ const ret = makeMutClosure(arg0, arg1, 142, __wbg_adapter_55);
2148
2935
  return addHeapObject(ret);
2149
2936
  };
2150
2937
 
@@ -2177,9 +2964,7 @@ function initSync(module) {
2177
2964
  }
2178
2965
 
2179
2966
  async function init(input) {
2180
- if (typeof input === 'undefined') {
2181
- input = new URL('index_bg.wasm', import.meta.url);
2182
- }
2967
+
2183
2968
  const imports = getImports();
2184
2969
 
2185
2970
  if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
@@ -2196,6 +2981,9 @@ var exports = /*#__PURE__*/Object.freeze({
2196
2981
  version: version,
2197
2982
  WirePolicy: WirePolicy$1,
2198
2983
  Ciphersuite: Ciphersuite$1,
2984
+ AcmeChallenge: AcmeChallenge,
2985
+ AcmeDirectory: AcmeDirectory,
2986
+ AcmeFinalize: AcmeFinalize,
2199
2987
  CommitBundle: CommitBundle,
2200
2988
  ConversationConfiguration: ConversationConfiguration,
2201
2989
  ConversationInitBundle: ConversationInitBundle,
@@ -2205,8 +2993,11 @@ var exports = /*#__PURE__*/Object.freeze({
2205
2993
  DecryptedMessage: DecryptedMessage,
2206
2994
  Invitee: Invitee,
2207
2995
  MemberAddedMessages: MemberAddedMessages,
2996
+ NewAcmeAuthz: NewAcmeAuthz,
2997
+ NewAcmeOrder: NewAcmeOrder,
2208
2998
  ProposalBundle: ProposalBundle,
2209
2999
  PublicGroupStateBundle: PublicGroupStateBundle,
3000
+ WireE2eIdentity: WireE2eIdentity$1,
2210
3001
  initSync: initSync,
2211
3002
  'default': init
2212
3003
  });
@@ -2214,7 +3005,7 @@ var exports = /*#__PURE__*/Object.freeze({
2214
3005
  var wasm = async (opt = {}) => {
2215
3006
  let {importHook, serverPath} = opt;
2216
3007
 
2217
- let path = "assets/core_crypto_ffi-394802ae.wasm";
3008
+ let path = "assets/core_crypto_ffi-7a5675cc.wasm";
2218
3009
 
2219
3010
  if (serverPath != null) {
2220
3011
  path = serverPath + /[^\/\\]*$/.exec(path)[0];
@@ -2230,39 +3021,39 @@ var wasm = async (opt = {}) => {
2230
3021
 
2231
3022
  // Wire
2232
3023
  // Copyright (C) 2022 Wire Swiss GmbH
2233
- var _a, _CoreCrypto_module, _CoreCrypto_cc;
3024
+ var _a, _CoreCrypto_module, _CoreCrypto_cc, _b, _WireE2eIdentity_module, _WireE2eIdentity_e2ei;
2234
3025
  /**
2235
- * see [core_crypto::prelude::CiphersuiteName]
2236
- */
3026
+ * see [core_crypto::prelude::CiphersuiteName]
3027
+ */
2237
3028
  var Ciphersuite;
2238
3029
  (function (Ciphersuite) {
2239
3030
  /**
2240
- * DH KEM x25519 | AES-GCM 128 | SHA2-256 | Ed25519
2241
- */
3031
+ * DH KEM x25519 | AES-GCM 128 | SHA2-256 | Ed25519
3032
+ */
2242
3033
  Ciphersuite[Ciphersuite["MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519"] = 1] = "MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519";
2243
3034
  /**
2244
- * DH KEM P256 | AES-GCM 128 | SHA2-256 | EcDSA P256
2245
- */
3035
+ * DH KEM P256 | AES-GCM 128 | SHA2-256 | EcDSA P256
3036
+ */
2246
3037
  Ciphersuite[Ciphersuite["MLS_128_DHKEMP256_AES128GCM_SHA256_P256"] = 2] = "MLS_128_DHKEMP256_AES128GCM_SHA256_P256";
2247
3038
  /**
2248
- * DH KEM x25519 | Chacha20Poly1305 | SHA2-256 | Ed25519
2249
- */
3039
+ * DH KEM x25519 | Chacha20Poly1305 | SHA2-256 | Ed25519
3040
+ */
2250
3041
  Ciphersuite[Ciphersuite["MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519"] = 3] = "MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519";
2251
3042
  /**
2252
- * DH KEM x448 | AES-GCM 256 | SHA2-512 | Ed448
2253
- */
3043
+ * DH KEM x448 | AES-GCM 256 | SHA2-512 | Ed448
3044
+ */
2254
3045
  Ciphersuite[Ciphersuite["MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448"] = 4] = "MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448";
2255
3046
  /**
2256
- * DH KEM P521 | AES-GCM 256 | SHA2-512 | EcDSA P521
2257
- */
3047
+ * DH KEM P521 | AES-GCM 256 | SHA2-512 | EcDSA P521
3048
+ */
2258
3049
  Ciphersuite[Ciphersuite["MLS_256_DHKEMP521_AES256GCM_SHA512_P521"] = 5] = "MLS_256_DHKEMP521_AES256GCM_SHA512_P521";
2259
3050
  /**
2260
- * DH KEM x448 | Chacha20Poly1305 | SHA2-512 | Ed448
2261
- */
3051
+ * DH KEM x448 | Chacha20Poly1305 | SHA2-512 | Ed448
3052
+ */
2262
3053
  Ciphersuite[Ciphersuite["MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448"] = 6] = "MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448";
2263
3054
  /**
2264
- * DH KEM P384 | AES-GCM 256 | SHA2-384 | EcDSA P384
2265
- */
3055
+ * DH KEM P384 | AES-GCM 256 | SHA2-384 | EcDSA P384
3056
+ */
2266
3057
  Ciphersuite[Ciphersuite["MLS_256_DHKEMP384_AES256GCM_SHA384_P384"] = 7] = "MLS_256_DHKEMP384_AES256GCM_SHA384_P384";
2267
3058
  })(Ciphersuite || (Ciphersuite = {}));
2268
3059
  /**
@@ -2808,7 +3599,7 @@ class CoreCrypto {
2808
3599
  * **CAUTION**: only use this when you had an explicit response from the Delivery Service
2809
3600
  * e.g. 403. Do not use otherwise e.g. 5xx responses, timeout etc..
2810
3601
  * **DO NOT** use when Delivery Service responds 409, pending state will be renewed
2811
- * in {@link CoreCrypto.decrypt_message}
3602
+ * in {@link CoreCrypto.decryptMessage}
2812
3603
  *
2813
3604
  * @param conversationId - The group's ID
2814
3605
  */
@@ -2888,6 +3679,8 @@ class CoreCrypto {
2888
3679
  /**
2889
3680
  * Locally persists a session to the keystore
2890
3681
  *
3682
+ * **Note**: This isn't usually needed as persisting sessions happens automatically when decrypting/encrypting messages and initializing Sessions
3683
+ *
2891
3684
  * @param sessionId - ID of the Proteus session
2892
3685
  */
2893
3686
  async proteusSessionSave(sessionId) {
@@ -2952,6 +3745,14 @@ class CoreCrypto {
2952
3745
  async proteusNewPrekey(prekeyId) {
2953
3746
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_new_prekey(prekeyId);
2954
3747
  }
3748
+ /**
3749
+ * Creates a new prekey with an automatically generated ID..
3750
+ *
3751
+ * @returns: A CBOR-serialized version of the PreKeyBundle corresponding to the newly generated and stored PreKey
3752
+ */
3753
+ async proteusNewPrekeyAuto() {
3754
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_new_prekey_auto();
3755
+ }
2955
3756
  /**
2956
3757
  * Proteus public key fingerprint
2957
3758
  * It's basically the public key encoded as an hex string
@@ -2984,7 +3785,7 @@ class CoreCrypto {
2984
3785
  *
2985
3786
  * @param prekey - the prekey bundle to get the fingerprint from
2986
3787
  * @returns Hex-encoded public key string
2987
- **/
3788
+ **/
2988
3789
  static proteusFingerprintPrekeybundle(prekey) {
2989
3790
  return __classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.proteus_fingerprint_prekeybundle(prekey);
2990
3791
  }
@@ -2996,6 +3797,18 @@ class CoreCrypto {
2996
3797
  async proteusCryptoboxMigrate(storeName) {
2997
3798
  return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").proteus_cryptobox_migrate(storeName);
2998
3799
  }
3800
+ /**
3801
+ * Creates an enrollment instance with private key material you can use in order to fetch
3802
+ * a new x509 certificate from the acme server.
3803
+ * Make sure to call [WireE2eIdentity::free] (not yet available) to dispose this instance and its associated
3804
+ * keying material.
3805
+ *
3806
+ * @param ciphersuite - For generating signing key material. Only {@link Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519} is supported currently
3807
+ */
3808
+ async newAcmeEnrollment() {
3809
+ const e2ei = await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_acme_enrollment(Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519);
3810
+ return new WireE2eIdentity(e2ei, __classPrivateFieldGet(CoreCrypto, _a, "f", _CoreCrypto_module));
3811
+ }
2999
3812
  /**
3000
3813
  * Returns the current version of {@link CoreCrypto}
3001
3814
  *
@@ -3011,5 +3824,197 @@ class CoreCrypto {
3011
3824
  _a = CoreCrypto, _CoreCrypto_cc = new WeakMap();
3012
3825
  /** @hidden */
3013
3826
  _CoreCrypto_module = { value: void 0 };
3827
+ class WireE2eIdentity {
3828
+ /** @hidden */
3829
+ constructor(e2ei, module) {
3830
+ /** @hidden */
3831
+ _WireE2eIdentity_e2ei.set(this, void 0);
3832
+ __classPrivateFieldSet(this, _WireE2eIdentity_e2ei, e2ei, "f");
3833
+ if (!__classPrivateFieldGet(WireE2eIdentity, _b, "f", _WireE2eIdentity_module)) {
3834
+ __classPrivateFieldSet(WireE2eIdentity, _b, module, "f", _WireE2eIdentity_module);
3835
+ }
3836
+ }
3837
+ /**
3838
+ * Parses the response from `GET /acme/{provisioner-name}/directory`.
3839
+ * Use this {@link AcmeDirectory} in the next step to fetch the first nonce from the acme server. Use
3840
+ * {@link AcmeDirectory.newNonce}.
3841
+ *
3842
+ * @param directory HTTP response body
3843
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
3844
+ */
3845
+ directoryResponse(directory) {
3846
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").directory_response(directory);
3847
+ }
3848
+ /**
3849
+ * For creating a new acme account. This returns a signed JWS-alike request body to send to
3850
+ * `POST /acme/{provisioner-name}/new-account`.
3851
+ *
3852
+ * @param directory you got from {@link directoryResponse}
3853
+ * @param previousNonce you got from calling `HEAD {@link AcmeDirectory.newNonce}`
3854
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
3855
+ */
3856
+ newAccountRequest(directory, previousNonce) {
3857
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_request(directory, previousNonce);
3858
+ }
3859
+ /**
3860
+ * Parses the response from `POST /acme/{provisioner-name}/new-account`.
3861
+ * @param account HTTP response body
3862
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
3863
+ */
3864
+ newAccountResponse(account) {
3865
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_response(account);
3866
+ }
3867
+ /**
3868
+ * Creates a new acme order for the handle (userId + display name) and the clientId.
3869
+ *
3870
+ * @param handle domain of the authorization server e.g. `idp.example.org`
3871
+ * @param clientId domain of the wire-server e.g. `wire.example.org`
3872
+ * @param expiryDays generated x509 certificate expiry
3873
+ * @param directory you got from {@link directoryResponse}
3874
+ * @param account you got from {@link newAccountResponse}
3875
+ * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-account`
3876
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
3877
+ */
3878
+ newOrderRequest(handle, clientId, expiryDays, directory, account, previousNonce) {
3879
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_request(handle, clientId, expiryDays, directory, account, previousNonce);
3880
+ }
3881
+ /**
3882
+ * Parses the response from `POST /acme/{provisioner-name}/new-order`.
3883
+ *
3884
+ * @param order HTTP response body
3885
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
3886
+ */
3887
+ newOrderResponse(order) {
3888
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_response(order);
3889
+ }
3890
+ /**
3891
+ * Creates a new authorization request.
3892
+ *
3893
+ * @param url one of the URL in new order's authorizations (use {@link NewAcmeOrder.authorizations} from {@link newOrderResponse})
3894
+ * @param account you got from {@link newAccountResponse}
3895
+ * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-order` (or from the
3896
+ * previous to this method if you are creating the second authorization)
3897
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
3898
+ */
3899
+ newAuthzRequest(url, account, previousNonce) {
3900
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_request(url, account, previousNonce);
3901
+ }
3902
+ /**
3903
+ * Parses the response from `POST /acme/{provisioner-name}/authz/{authz-id}`
3904
+ *
3905
+ * You then have to map the challenge from this authorization object. The `client_id_challenge`
3906
+ * will be the one with the `client_id_host` (you supplied to {@link newOrderRequest}) identifier,
3907
+ * the other will be your `handle_challenge`.
3908
+ *
3909
+ * @param authz HTTP response body
3910
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
3911
+ */
3912
+ newAuthzResponse(authz) {
3913
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_response(authz);
3914
+ }
3915
+ /**
3916
+ * Generates a new client Dpop JWT token. It demonstrates proof of possession of the nonces
3917
+ * (from wire-server & acme server) and will be verified by the acme server when verifying the
3918
+ * challenge (in order to deliver a certificate).
3919
+ *
3920
+ * Then send it to `POST /clients/{id}/access-token`
3921
+ * {@link https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_clients__cid__access_token} on wire-server.
3922
+ *
3923
+ * @param accessTokenUrl backend endpoint where this token will be sent. Should be this one {@link https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_clients__cid__access_token}
3924
+ * @param userId an UUIDv4 uniquely identifying the user
3925
+ * @param clientId client identifier
3926
+ * @param domain owning backend domain e.g. `wire.com`
3927
+ * @param clientIdChallenge you found after {@link newAuthzResponse}
3928
+ * @param backendNonce you get by calling `GET /clients/token/nonce` on wire-server as defined here {@link https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/get_clients__client__nonce}
3929
+ * @param expiryDays token expiry in days
3930
+ */
3931
+ createDpopToken(accessTokenUrl, userId, clientId, domain, clientIdChallenge, backendNonce, expiryDays) {
3932
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").create_dpop_token(accessTokenUrl, userId, clientId, domain, clientIdChallenge, backendNonce, expiryDays);
3933
+ }
3934
+ /**
3935
+ * Creates a new challenge request.
3936
+ *
3937
+ * @param handleChallenge you found after {@link newAuthzResponse}
3938
+ * @param account you found after {@link newAccountResponse}
3939
+ * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
3940
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
3941
+ */
3942
+ newChallengeRequest(handleChallenge, account, previousNonce) {
3943
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_challenge_request(handleChallenge, account, previousNonce);
3944
+ }
3945
+ /**
3946
+ * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}`.
3947
+ *
3948
+ * @param challenge HTTP response body
3949
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
3950
+ */
3951
+ newChallengeResponse(challenge) {
3952
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_challenge_response(challenge);
3953
+ }
3954
+ /**
3955
+ * Verifies that the previous challenge has been completed.
3956
+ *
3957
+ * @param orderUrl `location` header from http response you got from {@link newOrderResponse}
3958
+ * @param account you found after {@link newAccountResponse}
3959
+ * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
3960
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
3961
+ */
3962
+ checkOrderRequest(orderUrl, account, previousNonce) {
3963
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_request(orderUrl, account, previousNonce);
3964
+ }
3965
+ /**
3966
+ * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}`.
3967
+ *
3968
+ * @param order HTTP response body
3969
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
3970
+ */
3971
+ checkOrderResponse(order) {
3972
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_response(order);
3973
+ }
3974
+ /**
3975
+ * Final step before fetching the certificate.
3976
+ *
3977
+ * @param domains you want to generate a certificate for e.g. `["wire.com"]`
3978
+ * @param order you got from {@link checkOrderResponse}
3979
+ * @param account you found after {@link newAccountResponse}
3980
+ * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
3981
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
3982
+ */
3983
+ finalizeRequest(domains, order, account, previousNonce) {
3984
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_request(domains, order, account, previousNonce);
3985
+ }
3986
+ /**
3987
+ * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}/finalize`.
3988
+ *
3989
+ * @param finalize HTTP response body
3990
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
3991
+ */
3992
+ finalizeResponse(finalize) {
3993
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_response(finalize);
3994
+ }
3995
+ /**
3996
+ * Creates a request for finally fetching the x509 certificate.
3997
+ *
3998
+ * @param finalize you got from {@link finalizeResponse}
3999
+ * @param account you got from {@link newAccountResponse}
4000
+ * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}/finalize`
4001
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
4002
+ */
4003
+ certificateRequest(finalize, account, previousNonce) {
4004
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_request(finalize, account, previousNonce);
4005
+ }
4006
+ /**
4007
+ * Parses the response from `POST /acme/{provisioner-name}/certificate/{certificate-id}`.
4008
+ *
4009
+ * @param certificateChain HTTP string response body
4010
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
4011
+ */
4012
+ certificateResponse(certificateChain) {
4013
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_response(certificateChain);
4014
+ }
4015
+ }
4016
+ _b = WireE2eIdentity, _WireE2eIdentity_e2ei = new WeakMap();
4017
+ /** @hidden */
4018
+ _WireE2eIdentity_module = { value: void 0 };
3014
4019
 
3015
- export { Ciphersuite, CoreCrypto, ExternalProposalType, ProposalType, PublicGroupStateEncryptionType, RatchetTreeType, WirePolicy };
4020
+ export { Ciphersuite, CoreCrypto, ExternalProposalType, ProposalType, PublicGroupStateEncryptionType, RatchetTreeType, WireE2eIdentity, WirePolicy };