@wireapp/core-crypto 1.0.0-rc.12 → 1.0.0-rc.14

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wireapp/core-crypto",
3
- "version": "1.0.0-rc.12",
3
+ "version": "1.0.0-rc.14",
4
4
  "description": "CoreCrypto bindings for the Web",
5
5
  "type": "module",
6
6
  "module": "platforms/web/corecrypto.js",
@@ -1,3 +1,63 @@
1
+ declare class AcmeChallenge {
2
+ free(): void;
3
+ /**
4
+ * Contains raw JSON data of this challenge. This is parsed by the underlying Rust library hence should not be accessed
5
+ */
6
+ readonly delegate: Uint8Array;
7
+ /**
8
+ * Non-standard, Wire specific claim. Indicates the consumer from where it should get the challenge proof.
9
+ * Either from wire-server "/access-token" endpoint in case of a DPoP challenge, or from an OAuth token endpoint for an OIDC challenge
10
+ */
11
+ readonly target: string;
12
+ /**
13
+ * URL of this challenge
14
+ */
15
+ readonly url: string;
16
+ }
17
+ declare class AcmeDirectory {
18
+ free(): void;
19
+ /**
20
+ * URL for creating a new account.
21
+ */
22
+ readonly newAccount: string;
23
+ /**
24
+ * URL for fetching a new nonce. Use this only for creating a new account.
25
+ */
26
+ readonly newNonce: string;
27
+ /**
28
+ * URL for creating a new order.
29
+ */
30
+ readonly newOrder: string;
31
+ /**
32
+ * Revocation URL
33
+ */
34
+ readonly revokeCert: string;
35
+ }
36
+ declare class NewAcmeAuthz {
37
+ free(): void;
38
+ /**
39
+ * DNS entry associated with those challenge
40
+ */
41
+ readonly identifier: string;
42
+ /**
43
+ * Challenge for the deviceId owned by wire-server
44
+ */
45
+ readonly wireDpopChallenge: AcmeChallenge | undefined;
46
+ /**
47
+ * Challenge for the userId and displayName owned by the identity provider
48
+ */
49
+ readonly wireOidcChallenge: AcmeChallenge | undefined;
50
+ }
51
+ declare class NewAcmeOrder {
52
+ free(): void;
53
+ /**
54
+ */
55
+ readonly authorizations: (Uint8Array)[];
56
+ /**
57
+ * Contains raw JSON data of this order. This is parsed by the underlying Rust library hence should not be accessed
58
+ */
59
+ readonly delegate: Uint8Array;
60
+ }
1
61
  /**
2
62
  * Error wrapper that takes care of extracting rich error details across the FFI (through JSON parsing)
3
63
  *
@@ -303,6 +363,10 @@ export interface CoreCryptoDeferredParams {
303
363
  * .wasm file path, this will be useful in case your bundling system likes to relocate files (i.e. what webpack does)
304
364
  */
305
365
  wasmFilePath?: string;
366
+ /**
367
+ * Number of initial KeyPackage to create when initializing the client
368
+ */
369
+ nbKeyPackage?: number;
306
370
  }
307
371
  /**
308
372
  * Params for CoreCrypto initialization
@@ -616,7 +680,7 @@ export declare class CoreCrypto {
616
680
  * });
617
681
  * ````
618
682
  */
619
- static init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed }: CoreCryptoParams): Promise<CoreCrypto>;
683
+ static init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed, nbKeyPackage, }: CoreCryptoParams): Promise<CoreCrypto>;
620
684
  /**
621
685
  * Almost identical to {@link CoreCrypto.init} but allows a 2 phase initialization of MLS.
622
686
  * First, calling this will set up the keystore and will allow generating proteus prekeys.
@@ -624,14 +688,15 @@ export declare class CoreCrypto {
624
688
  * Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
625
689
  * @param params - {@link CoreCryptoDeferredParams}
626
690
  */
627
- static deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
691
+ static deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath, nbKeyPackage, }: CoreCryptoDeferredParams): Promise<CoreCrypto>;
628
692
  /**
629
693
  * Use this after {@link CoreCrypto.deferredInit} when you have a clientId. It initializes MLS.
630
694
  *
631
695
  * @param clientId - {@link CoreCryptoParams#clientId} but required
632
696
  * @param ciphersuites - All the ciphersuites supported by this MLS client
697
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
633
698
  */
634
- mlsInit(clientId: ClientId, ciphersuites: Ciphersuite[]): Promise<void>;
699
+ mlsInit(clientId: ClientId, ciphersuites: Ciphersuite[], nbKeyPackage?: number): Promise<void>;
635
700
  /**
636
701
  * Generates a MLS KeyPair/CredentialBundle with a temporary, random client ID.
637
702
  * This method is designed to be used in conjunction with {@link CoreCrypto.mlsInitWithClientId} and represents the first step in this process
@@ -1107,7 +1172,7 @@ export declare class CoreCrypto {
1107
1172
  * Creates an enrollment instance with private key material you can use in order to fetch
1108
1173
  * a new x509 certificate from the acme server.
1109
1174
  *
1110
- * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1175
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `t6wRpI8BRSeviBwwiFp5MQ:6add501bacd1d90e@example.com`
1111
1176
  * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1112
1177
  * @param handle - user handle e.g. `alice.smith.qa@example.com`
1113
1178
  * @param expiryDays - generated x509 certificate expiry
@@ -1119,7 +1184,7 @@ export declare class CoreCrypto {
1119
1184
  * Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI.
1120
1185
  * Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
1121
1186
  *
1122
- * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1187
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `t6wRpI8BRSeviBwwiFp5MQ:6add501bacd1d90e@example.com`
1123
1188
  * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
1124
1189
  * @param handle - user handle e.g. `alice.smith.qa@example.com`
1125
1190
  * @param expiryDays - generated x509 certificate expiry
@@ -1133,7 +1198,7 @@ export declare class CoreCrypto {
1133
1198
  * has been revoked. It lets you change the DisplayName or the handle
1134
1199
  * if you need to. Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
1135
1200
  *
1136
- * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1201
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `t6wRpI8BRSeviBwwiFp5MQ:6add501bacd1d90e@example.com`
1137
1202
  * @param expiryDays - generated x509 certificate expiry
1138
1203
  * @param ciphersuite - for generating signing key material
1139
1204
  * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
@@ -1147,9 +1212,10 @@ export declare class CoreCrypto {
1147
1212
  *
1148
1213
  * @param enrollment - the enrollment instance used to fetch the certificates
1149
1214
  * @param certificateChain - the raw response from ACME server
1215
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
1150
1216
  * @returns a MlsClient initialized with only a x509 credential
1151
1217
  */
1152
- e2eiMlsInitOnly(enrollment: E2eiEnrollment, certificateChain: string): Promise<void>;
1218
+ e2eiMlsInitOnly(enrollment: E2eiEnrollment, certificateChain: string, nbKeyPackage?: number): Promise<void>;
1153
1219
  /**
1154
1220
  * Creates a commit in all local conversations for changing the credential. Requires first
1155
1221
  * having enrolled a new X509 certificate with either {@link CoreCrypto.e2eiNewActivationEnrollment}
@@ -1344,103 +1410,6 @@ export declare class E2eiEnrollment {
1344
1410
  */
1345
1411
  certificateRequest(previousNonce: string): JsonRawData;
1346
1412
  }
1347
- /**
1348
- * Holds URLs of all the standard ACME endpoint supported on an ACME server.
1349
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
1350
- */
1351
- export interface AcmeDirectory {
1352
- /**
1353
- * URL for fetching a new nonce. Use this only for creating a new account.
1354
- *
1355
- * @readonly
1356
- */
1357
- newNonce: string;
1358
- /**
1359
- * URL for creating a new account.
1360
- *
1361
- * @readonly
1362
- */
1363
- newAccount: string;
1364
- /**
1365
- * URL for creating a new order.
1366
- *
1367
- * @readonly
1368
- */
1369
- newOrder: string;
1370
- /**
1371
- * Revocation URL
1372
- *
1373
- * @readonly
1374
- */
1375
- revokeCert: string;
1376
- }
1377
- /**
1378
- * Result of an order creation
1379
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1380
- */
1381
- export interface NewAcmeOrder {
1382
- /**
1383
- * Contains raw JSON data of this order. This is parsed by the underlying Rust library hence should not be accessed
1384
- *
1385
- * @readonly
1386
- */
1387
- delegate: Uint8Array;
1388
- /**
1389
- * An authorization for each domain to create
1390
- *
1391
- * @readonly
1392
- */
1393
- authorizations: Uint8Array[];
1394
- }
1395
- /**
1396
- * Result of an authorization creation.
1397
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1398
- */
1399
- export interface NewAcmeAuthz {
1400
- /**
1401
- * DNS entry associated with those challenge
1402
- *
1403
- * @readonly
1404
- */
1405
- identifier: string;
1406
- /**
1407
- * Challenge for the clientId
1408
- *
1409
- * @readonly
1410
- */
1411
- wireDpopChallenge?: AcmeChallenge;
1412
- /**
1413
- * Challenge for the userId and displayName
1414
- *
1415
- * @readonly
1416
- */
1417
- wireOidcChallenge?: AcmeChallenge;
1418
- }
1419
- /**
1420
- * For creating a challenge
1421
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1422
- */
1423
- export interface AcmeChallenge {
1424
- /**
1425
- * Contains raw JSON data of this challenge. This is parsed by the underlying Rust library hence should not be accessed
1426
- *
1427
- * @readonly
1428
- */
1429
- delegate: Uint8Array;
1430
- /**
1431
- * URL of this challenge
1432
- *
1433
- * @readonly
1434
- */
1435
- url: string;
1436
- /**
1437
- * Non-standard, Wire specific claim. Indicates the consumer from where it should get the challenge proof.
1438
- * Either from wire-server "/access-token" endpoint in case of a DPoP challenge, or from an OAuth token endpoint for an OIDC challenge
1439
- *
1440
- * @readonly
1441
- */
1442
- target: string;
1443
- }
1444
1413
  /**
1445
1414
  * Indicates the state of a Conversation regarding end-to-end identity.
1446
1415
  * Note: this does not check pending state (pending commit, pending proposals) so it does not
@@ -35,9 +35,23 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
35
35
  };
36
36
 
37
37
  let wasm$1;
38
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available'); } });
39
+ if (typeof TextDecoder !== 'undefined') {
40
+ cachedTextDecoder.decode();
41
+ }
42
+ let cachedUint8Memory0 = null;
43
+ function getUint8Memory0() {
44
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
45
+ cachedUint8Memory0 = new Uint8Array(wasm$1.memory.buffer);
46
+ }
47
+ return cachedUint8Memory0;
48
+ }
49
+ function getStringFromWasm0(ptr, len) {
50
+ ptr = ptr >>> 0;
51
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
52
+ }
38
53
  const heap = new Array(128).fill(undefined);
39
54
  heap.push(undefined, null, true, false);
40
- function getObject(idx) { return heap[idx]; }
41
55
  let heap_next = heap.length;
42
56
  function addHeapObject(obj) {
43
57
  if (heap_next === heap.length)
@@ -47,6 +61,7 @@ function addHeapObject(obj) {
47
61
  heap[idx] = obj;
48
62
  return idx;
49
63
  }
64
+ function getObject(idx) { return heap[idx]; }
50
65
  function dropObject(idx) {
51
66
  if (idx < 132)
52
67
  return;
@@ -58,21 +73,6 @@ function takeObject(idx) {
58
73
  dropObject(idx);
59
74
  return ret;
60
75
  }
61
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available'); } });
62
- if (typeof TextDecoder !== 'undefined') {
63
- cachedTextDecoder.decode();
64
- }
65
- let cachedUint8Memory0 = null;
66
- function getUint8Memory0() {
67
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
68
- cachedUint8Memory0 = new Uint8Array(wasm$1.memory.buffer);
69
- }
70
- return cachedUint8Memory0;
71
- }
72
- function getStringFromWasm0(ptr, len) {
73
- ptr = ptr >>> 0;
74
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
75
- }
76
76
  let WASM_VECTOR_LEN = 0;
77
77
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available'); } });
78
78
  const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
@@ -234,12 +234,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
234
234
  return real;
235
235
  }
236
236
  function __wbg_adapter_52(arg0, arg1, arg2) {
237
- wasm$1.wasm_bindgen__convert__closures__invoke1_mut__hdb6540dbb26cf63b(arg0, arg1, addHeapObject(arg2));
237
+ wasm$1.wasm_bindgen__convert__closures__invoke1_mut__ha447962224b266eb(arg0, arg1, addHeapObject(arg2));
238
238
  }
239
239
  function __wbg_adapter_55(arg0, arg1, arg2) {
240
240
  try {
241
241
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
242
- wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h3c15a82f614455aa(retptr, arg0, arg1, addHeapObject(arg2));
242
+ wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h356d4ae76e3804e9(retptr, arg0, arg1, addHeapObject(arg2));
243
243
  var r0 = getInt32Memory0()[retptr / 4 + 0];
244
244
  var r1 = getInt32Memory0()[retptr / 4 + 1];
245
245
  if (r1) {
@@ -250,11 +250,9 @@ function __wbg_adapter_55(arg0, arg1, arg2) {
250
250
  wasm$1.__wbindgen_add_to_stack_pointer(16);
251
251
  }
252
252
  }
253
- function _assertClass(instance, klass) {
254
- if (!(instance instanceof klass)) {
255
- throw new Error(`expected instance of ${klass.name}`);
256
- }
257
- return instance.ptr;
253
+ function getArrayU8FromWasm0(ptr, len) {
254
+ ptr = ptr >>> 0;
255
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
258
256
  }
259
257
  let cachedUint32Memory0 = null;
260
258
  function getUint32Memory0() {
@@ -263,14 +261,15 @@ function getUint32Memory0() {
263
261
  }
264
262
  return cachedUint32Memory0;
265
263
  }
266
- function passArrayJsValueToWasm0(array, malloc) {
267
- const ptr = malloc(array.length * 4, 4) >>> 0;
264
+ function getArrayJsValueFromWasm0(ptr, len) {
265
+ ptr = ptr >>> 0;
268
266
  const mem = getUint32Memory0();
269
- for (let i = 0; i < array.length; i++) {
270
- mem[ptr / 4 + i] = addHeapObject(array[i]);
267
+ const slice = mem.subarray(ptr / 4, ptr / 4 + len);
268
+ const result = [];
269
+ for (let i = 0; i < slice.length; i++) {
270
+ result.push(takeObject(slice[i]));
271
271
  }
272
- WASM_VECTOR_LEN = array.length;
273
- return ptr;
272
+ return result;
274
273
  }
275
274
  function passArray8ToWasm0(arg, malloc) {
276
275
  const ptr = malloc(arg.length * 1, 1) >>> 0;
@@ -278,6 +277,21 @@ function passArray8ToWasm0(arg, malloc) {
278
277
  WASM_VECTOR_LEN = arg.length;
279
278
  return ptr;
280
279
  }
280
+ function _assertClass(instance, klass) {
281
+ if (!(instance instanceof klass)) {
282
+ throw new Error(`expected instance of ${klass.name}`);
283
+ }
284
+ return instance.ptr;
285
+ }
286
+ function passArrayJsValueToWasm0(array, malloc) {
287
+ const ptr = malloc(array.length * 4, 4) >>> 0;
288
+ const mem = getUint32Memory0();
289
+ for (let i = 0; i < array.length; i++) {
290
+ mem[ptr / 4 + i] = addHeapObject(array[i]);
291
+ }
292
+ WASM_VECTOR_LEN = array.length;
293
+ return ptr;
294
+ }
281
295
  let cachedUint16Memory0 = null;
282
296
  function getUint16Memory0() {
283
297
  if (cachedUint16Memory0 === null || cachedUint16Memory0.byteLength === 0) {
@@ -291,20 +305,6 @@ function passArray16ToWasm0(arg, malloc) {
291
305
  WASM_VECTOR_LEN = arg.length;
292
306
  return ptr;
293
307
  }
294
- function getArrayJsValueFromWasm0(ptr, len) {
295
- ptr = ptr >>> 0;
296
- const mem = getUint32Memory0();
297
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
298
- const result = [];
299
- for (let i = 0; i < slice.length; i++) {
300
- result.push(takeObject(slice[i]));
301
- }
302
- return result;
303
- }
304
- function getArrayU8FromWasm0(ptr, len) {
305
- ptr = ptr >>> 0;
306
- return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
307
- }
308
308
  function handleError(f, args) {
309
309
  try {
310
310
  return f.apply(this, args);
@@ -313,8 +313,8 @@ function handleError(f, args) {
313
313
  wasm$1.__wbindgen_exn_store(addHeapObject(e));
314
314
  }
315
315
  }
316
- function __wbg_adapter_312(arg0, arg1, arg2, arg3) {
317
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h5286c52f12e3fed2(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
316
+ function __wbg_adapter_308(arg0, arg1, arg2, arg3) {
317
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h818732dcca963bda(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
318
318
  }
319
319
  /**
320
320
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -379,7 +379,8 @@ const Ciphersuite$1 = Object.freeze({
379
379
  MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519: 61489, "61489": "MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519",
380
380
  });
381
381
  /**
382
- * See [core_crypto::e2e_identity::types::E2eiAcmeChallenge]
382
+ * For creating a challenge.
383
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
383
384
  */
384
385
  class AcmeChallenge {
385
386
  static __wrap(ptr) {
@@ -398,26 +399,25 @@ class AcmeChallenge {
398
399
  wasm$1.__wbg_acmechallenge_free(ptr);
399
400
  }
400
401
  /**
401
- * @param {Uint8Array} delegate
402
- * @param {string} url
403
- * @param {string} target
404
- */
405
- constructor(delegate, url, target) {
406
- const ptr0 = passStringToWasm0(url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
407
- const len0 = WASM_VECTOR_LEN;
408
- const ptr1 = passStringToWasm0(target, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
409
- const len1 = WASM_VECTOR_LEN;
410
- const ret = wasm$1.acmechallenge_new(addHeapObject(delegate), ptr0, len0, ptr1, len1);
411
- return AcmeChallenge.__wrap(ret);
412
- }
413
- /**
402
+ * Contains raw JSON data of this challenge. This is parsed by the underlying Rust library hence should not be accessed
414
403
  * @returns {Uint8Array}
415
404
  */
416
405
  get delegate() {
417
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
418
- return takeObject(ret);
406
+ try {
407
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
408
+ wasm$1.__wbg_get_acmechallenge_delegate(retptr, this.__wbg_ptr);
409
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
410
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
411
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
412
+ wasm$1.__wbindgen_free(r0, r1 * 1);
413
+ return v1;
414
+ }
415
+ finally {
416
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
417
+ }
419
418
  }
420
419
  /**
420
+ * URL of this challenge
421
421
  * @returns {string}
422
422
  */
423
423
  get url() {
@@ -425,7 +425,7 @@ class AcmeChallenge {
425
425
  let deferred1_1;
426
426
  try {
427
427
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
428
- wasm$1.acmechallenge_url(retptr, this.__wbg_ptr);
428
+ wasm$1.__wbg_get_acmechallenge_url(retptr, this.__wbg_ptr);
429
429
  var r0 = getInt32Memory0()[retptr / 4 + 0];
430
430
  var r1 = getInt32Memory0()[retptr / 4 + 1];
431
431
  deferred1_0 = r0;
@@ -438,6 +438,8 @@ class AcmeChallenge {
438
438
  }
439
439
  }
440
440
  /**
441
+ * Non-standard, Wire specific claim. Indicates the consumer from where it should get the challenge proof.
442
+ * Either from wire-server "/access-token" endpoint in case of a DPoP challenge, or from an OAuth token endpoint for an OIDC challenge
441
443
  * @returns {string}
442
444
  */
443
445
  get target() {
@@ -445,7 +447,7 @@ class AcmeChallenge {
445
447
  let deferred1_1;
446
448
  try {
447
449
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
448
- wasm$1.acmechallenge_target(retptr, this.__wbg_ptr);
450
+ wasm$1.__wbg_get_acmechallenge_target(retptr, this.__wbg_ptr);
449
451
  var r0 = getInt32Memory0()[retptr / 4 + 0];
450
452
  var r1 = getInt32Memory0()[retptr / 4 + 1];
451
453
  deferred1_0 = r0;
@@ -459,7 +461,8 @@ class AcmeChallenge {
459
461
  }
460
462
  }
461
463
  /**
462
- * See [core_crypto::e2e_identity::types::E2eiAcmeDirectory]
464
+ * Holds URLs of all the standard ACME endpoint supported on an ACME server.
465
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
463
466
  */
464
467
  class AcmeDirectory {
465
468
  static __wrap(ptr) {
@@ -478,24 +481,7 @@ class AcmeDirectory {
478
481
  wasm$1.__wbg_acmedirectory_free(ptr);
479
482
  }
480
483
  /**
481
- * @param {string} new_nonce
482
- * @param {string} new_account
483
- * @param {string} new_order
484
- * @param {string} revoke_cert
485
- */
486
- constructor(new_nonce, new_account, new_order, revoke_cert) {
487
- const ptr0 = passStringToWasm0(new_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
488
- const len0 = WASM_VECTOR_LEN;
489
- const ptr1 = passStringToWasm0(new_account, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
490
- const len1 = WASM_VECTOR_LEN;
491
- const ptr2 = passStringToWasm0(new_order, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
492
- const len2 = WASM_VECTOR_LEN;
493
- const ptr3 = passStringToWasm0(revoke_cert, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
494
- const len3 = WASM_VECTOR_LEN;
495
- const ret = wasm$1.acmedirectory_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
496
- return AcmeDirectory.__wrap(ret);
497
- }
498
- /**
484
+ * URL for fetching a new nonce. Use this only for creating a new account.
499
485
  * @returns {string}
500
486
  */
501
487
  get newNonce() {
@@ -503,7 +489,7 @@ class AcmeDirectory {
503
489
  let deferred1_1;
504
490
  try {
505
491
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
506
- wasm$1.acmedirectory_newNonce(retptr, this.__wbg_ptr);
492
+ wasm$1.__wbg_get_acmedirectory_newNonce(retptr, this.__wbg_ptr);
507
493
  var r0 = getInt32Memory0()[retptr / 4 + 0];
508
494
  var r1 = getInt32Memory0()[retptr / 4 + 1];
509
495
  deferred1_0 = r0;
@@ -516,6 +502,7 @@ class AcmeDirectory {
516
502
  }
517
503
  }
518
504
  /**
505
+ * URL for creating a new account.
519
506
  * @returns {string}
520
507
  */
521
508
  get newAccount() {
@@ -523,7 +510,7 @@ class AcmeDirectory {
523
510
  let deferred1_1;
524
511
  try {
525
512
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
526
- wasm$1.acmechallenge_url(retptr, this.__wbg_ptr);
513
+ wasm$1.__wbg_get_acmechallenge_url(retptr, this.__wbg_ptr);
527
514
  var r0 = getInt32Memory0()[retptr / 4 + 0];
528
515
  var r1 = getInt32Memory0()[retptr / 4 + 1];
529
516
  deferred1_0 = r0;
@@ -536,6 +523,7 @@ class AcmeDirectory {
536
523
  }
537
524
  }
538
525
  /**
526
+ * URL for creating a new order.
539
527
  * @returns {string}
540
528
  */
541
529
  get newOrder() {
@@ -543,7 +531,7 @@ class AcmeDirectory {
543
531
  let deferred1_1;
544
532
  try {
545
533
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
546
- wasm$1.acmechallenge_target(retptr, this.__wbg_ptr);
534
+ wasm$1.__wbg_get_acmechallenge_target(retptr, this.__wbg_ptr);
547
535
  var r0 = getInt32Memory0()[retptr / 4 + 0];
548
536
  var r1 = getInt32Memory0()[retptr / 4 + 1];
549
537
  deferred1_0 = r0;
@@ -556,6 +544,7 @@ class AcmeDirectory {
556
544
  }
557
545
  }
558
546
  /**
547
+ * Revocation URL
559
548
  * @returns {string}
560
549
  */
561
550
  get revokeCert() {
@@ -563,7 +552,7 @@ class AcmeDirectory {
563
552
  let deferred1_1;
564
553
  try {
565
554
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
566
- wasm$1.acmedirectory_revokeCert(retptr, this.__wbg_ptr);
555
+ wasm$1.__wbg_get_acmedirectory_revokeCert(retptr, this.__wbg_ptr);
567
556
  var r0 = getInt32Memory0()[retptr / 4 + 0];
568
557
  var r1 = getInt32Memory0()[retptr / 4 + 1];
569
558
  deferred1_0 = r0;
@@ -675,7 +664,7 @@ class CommitBundle {
675
664
  * @returns {Uint8Array}
676
665
  */
677
666
  get commit() {
678
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
667
+ const ret = wasm$1.commitbundle_commit(this.__wbg_ptr);
679
668
  return takeObject(ret);
680
669
  }
681
670
  /**
@@ -754,7 +743,7 @@ class ConversationInitBundle {
754
743
  * @returns {Uint8Array}
755
744
  */
756
745
  get conversation_id() {
757
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
746
+ const ret = wasm$1.commitbundle_commit(this.__wbg_ptr);
758
747
  return takeObject(ret);
759
748
  }
760
749
  /**
@@ -857,14 +846,15 @@ let CoreCrypto$1 = class CoreCrypto {
857
846
  * see [core_crypto::mls::MlsCentral::e2ei_mls_init_only]
858
847
  * @param {FfiWireE2EIdentity} enrollment
859
848
  * @param {string} certificate_chain
849
+ * @param {number | undefined} nb_key_package
860
850
  * @returns {Promise<any>}
861
851
  */
862
- e2ei_mls_init_only(enrollment, certificate_chain) {
852
+ e2ei_mls_init_only(enrollment, certificate_chain, nb_key_package) {
863
853
  _assertClass(enrollment, FfiWireE2EIdentity);
864
854
  var ptr0 = enrollment.__destroy_into_raw();
865
855
  const ptr1 = passStringToWasm0(certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
866
856
  const len1 = WASM_VECTOR_LEN;
867
- const ret = wasm$1.corecrypto_e2ei_mls_init_only(this.__wbg_ptr, ptr0, ptr1, len1);
857
+ const ret = wasm$1.corecrypto_e2ei_mls_init_only(this.__wbg_ptr, ptr0, ptr1, len1, !isLikeNone(nb_key_package), isLikeNone(nb_key_package) ? 0 : nb_key_package);
868
858
  return takeObject(ret);
869
859
  }
870
860
  /**
@@ -972,9 +962,10 @@ let CoreCrypto$1 = class CoreCrypto {
972
962
  * @param {Uint8Array} client_id
973
963
  * @param {Uint16Array} ciphersuites
974
964
  * @param {Uint8Array | undefined} entropy_seed
965
+ * @param {number | undefined} nb_key_package
975
966
  * @returns {Promise<CoreCrypto>}
976
967
  */
977
- static _internal_new(path, key, client_id, ciphersuites, entropy_seed) {
968
+ static _internal_new(path, key, client_id, ciphersuites, entropy_seed, nb_key_package) {
978
969
  const ptr0 = passStringToWasm0(path, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
979
970
  const len0 = WASM_VECTOR_LEN;
980
971
  const ptr1 = passStringToWasm0(key, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
@@ -985,7 +976,7 @@ let CoreCrypto$1 = class CoreCrypto {
985
976
  const len3 = WASM_VECTOR_LEN;
986
977
  var ptr4 = isLikeNone(entropy_seed) ? 0 : passArray8ToWasm0(entropy_seed, wasm$1.__wbindgen_malloc);
987
978
  var len4 = WASM_VECTOR_LEN;
988
- const ret = wasm$1.corecrypto__internal_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
979
+ const ret = wasm$1.corecrypto__internal_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, !isLikeNone(nb_key_package), isLikeNone(nb_key_package) ? 0 : nb_key_package);
989
980
  return takeObject(ret);
990
981
  }
991
982
  /**
@@ -994,9 +985,10 @@ let CoreCrypto$1 = class CoreCrypto {
994
985
  * @param {string} key
995
986
  * @param {Uint16Array} ciphersuites
996
987
  * @param {Uint8Array | undefined} entropy_seed
988
+ * @param {number | undefined} nb_key_package
997
989
  * @returns {Promise<CoreCrypto>}
998
990
  */
999
- static deferred_init(path, key, ciphersuites, entropy_seed) {
991
+ static deferred_init(path, key, ciphersuites, entropy_seed, nb_key_package) {
1000
992
  const ptr0 = passStringToWasm0(path, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1001
993
  const len0 = WASM_VECTOR_LEN;
1002
994
  const ptr1 = passStringToWasm0(key, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
@@ -1005,21 +997,22 @@ let CoreCrypto$1 = class CoreCrypto {
1005
997
  const len2 = WASM_VECTOR_LEN;
1006
998
  var ptr3 = isLikeNone(entropy_seed) ? 0 : passArray8ToWasm0(entropy_seed, wasm$1.__wbindgen_malloc);
1007
999
  var len3 = WASM_VECTOR_LEN;
1008
- const ret = wasm$1.corecrypto_deferred_init(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
1000
+ const ret = wasm$1.corecrypto_deferred_init(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, !isLikeNone(nb_key_package), isLikeNone(nb_key_package) ? 0 : nb_key_package);
1009
1001
  return takeObject(ret);
1010
1002
  }
1011
1003
  /**
1012
1004
  * see [core_crypto::mls::MlsCentral::mls_init]
1013
1005
  * @param {Uint8Array} client_id
1014
1006
  * @param {Uint16Array} ciphersuites
1007
+ * @param {number | undefined} nb_key_package
1015
1008
  * @returns {Promise<any>}
1016
1009
  */
1017
- mls_init(client_id, ciphersuites) {
1010
+ mls_init(client_id, ciphersuites, nb_key_package) {
1018
1011
  const ptr0 = passArray8ToWasm0(client_id, wasm$1.__wbindgen_malloc);
1019
1012
  const len0 = WASM_VECTOR_LEN;
1020
1013
  const ptr1 = passArray16ToWasm0(ciphersuites, wasm$1.__wbindgen_malloc);
1021
1014
  const len1 = WASM_VECTOR_LEN;
1022
- const ret = wasm$1.corecrypto_mls_init(this.__wbg_ptr, ptr0, len0, ptr1, len1);
1015
+ const ret = wasm$1.corecrypto_mls_init(this.__wbg_ptr, ptr0, len0, ptr1, len1, !isLikeNone(nb_key_package), isLikeNone(nb_key_package) ? 0 : nb_key_package);
1023
1016
  return takeObject(ret);
1024
1017
  }
1025
1018
  /**
@@ -2387,7 +2380,7 @@ class GroupInfoBundle {
2387
2380
  * @returns {Uint8Array}
2388
2381
  */
2389
2382
  get payload() {
2390
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
2383
+ const ret = wasm$1.commitbundle_commit(this.__wbg_ptr);
2391
2384
  return takeObject(ret);
2392
2385
  }
2393
2386
  }
@@ -2422,7 +2415,7 @@ class Invitee {
2422
2415
  * @returns {Uint8Array}
2423
2416
  */
2424
2417
  get id() {
2425
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
2418
+ const ret = wasm$1.commitbundle_commit(this.__wbg_ptr);
2426
2419
  return takeObject(ret);
2427
2420
  }
2428
2421
  /**
@@ -2467,7 +2460,7 @@ class MemberAddedMessages {
2467
2460
  * @returns {Uint8Array}
2468
2461
  */
2469
2462
  get welcome() {
2470
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
2463
+ const ret = wasm$1.commitbundle_commit(this.__wbg_ptr);
2471
2464
  return takeObject(ret);
2472
2465
  }
2473
2466
  /**
@@ -2486,7 +2479,8 @@ class MemberAddedMessages {
2486
2479
  }
2487
2480
  }
2488
2481
  /**
2489
- * See [core_crypto::e2e_identity::types::E2eiNewAcmeAuthz]
2482
+ * Result of an authorization creation.
2483
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
2490
2484
  */
2491
2485
  class NewAcmeAuthz {
2492
2486
  static __wrap(ptr) {
@@ -2505,27 +2499,7 @@ class NewAcmeAuthz {
2505
2499
  wasm$1.__wbg_newacmeauthz_free(ptr);
2506
2500
  }
2507
2501
  /**
2508
- * @param {string} identifier
2509
- * @param {AcmeChallenge | undefined} wire_dpop_challenge
2510
- * @param {AcmeChallenge | undefined} wire_oidc_challenge
2511
- */
2512
- constructor(identifier, wire_dpop_challenge, wire_oidc_challenge) {
2513
- const ptr0 = passStringToWasm0(identifier, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2514
- const len0 = WASM_VECTOR_LEN;
2515
- let ptr1 = 0;
2516
- if (!isLikeNone(wire_dpop_challenge)) {
2517
- _assertClass(wire_dpop_challenge, AcmeChallenge);
2518
- ptr1 = wire_dpop_challenge.__destroy_into_raw();
2519
- }
2520
- let ptr2 = 0;
2521
- if (!isLikeNone(wire_oidc_challenge)) {
2522
- _assertClass(wire_oidc_challenge, AcmeChallenge);
2523
- ptr2 = wire_oidc_challenge.__destroy_into_raw();
2524
- }
2525
- const ret = wasm$1.newacmeauthz_new(ptr0, len0, ptr1, ptr2);
2526
- return NewAcmeAuthz.__wrap(ret);
2527
- }
2528
- /**
2502
+ * DNS entry associated with those challenge
2529
2503
  * @returns {string}
2530
2504
  */
2531
2505
  get identifier() {
@@ -2533,7 +2507,7 @@ class NewAcmeAuthz {
2533
2507
  let deferred1_1;
2534
2508
  try {
2535
2509
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2536
- wasm$1.acmedirectory_newNonce(retptr, this.__wbg_ptr);
2510
+ wasm$1.__wbg_get_acmedirectory_newNonce(retptr, this.__wbg_ptr);
2537
2511
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2538
2512
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2539
2513
  deferred1_0 = r0;
@@ -2546,22 +2520,25 @@ class NewAcmeAuthz {
2546
2520
  }
2547
2521
  }
2548
2522
  /**
2523
+ * Challenge for the deviceId owned by wire-server
2549
2524
  * @returns {AcmeChallenge | undefined}
2550
2525
  */
2551
2526
  get wireDpopChallenge() {
2552
- const ret = wasm$1.newacmeauthz_wireDpopChallenge(this.__wbg_ptr);
2527
+ const ret = wasm$1.__wbg_get_newacmeauthz_wireDpopChallenge(this.__wbg_ptr);
2553
2528
  return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
2554
2529
  }
2555
2530
  /**
2531
+ * Challenge for the userId and displayName owned by the identity provider
2556
2532
  * @returns {AcmeChallenge | undefined}
2557
2533
  */
2558
2534
  get wireOidcChallenge() {
2559
- const ret = wasm$1.newacmeauthz_wireOidcChallenge(this.__wbg_ptr);
2535
+ const ret = wasm$1.__wbg_get_newacmeauthz_wireOidcChallenge(this.__wbg_ptr);
2560
2536
  return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
2561
2537
  }
2562
2538
  }
2563
2539
  /**
2564
- * See [core_crypto::e2e_identity::types::E2eiNewAcmeOrder]
2540
+ * Result of an order creation.
2541
+ * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
2565
2542
  */
2566
2543
  class NewAcmeOrder {
2567
2544
  static __wrap(ptr) {
@@ -2580,28 +2557,39 @@ class NewAcmeOrder {
2580
2557
  wasm$1.__wbg_newacmeorder_free(ptr);
2581
2558
  }
2582
2559
  /**
2583
- * @param {Uint8Array} delegate
2584
- * @param {(Uint8Array)[]} authorizations
2560
+ * @returns {(Uint8Array)[]}
2585
2561
  */
2586
- constructor(delegate, authorizations) {
2587
- const ptr0 = passArrayJsValueToWasm0(authorizations, wasm$1.__wbindgen_malloc);
2588
- const len0 = WASM_VECTOR_LEN;
2589
- const ret = wasm$1.newacmeorder_new(addHeapObject(delegate), ptr0, len0);
2590
- return NewAcmeOrder.__wrap(ret);
2562
+ get authorizations() {
2563
+ try {
2564
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2565
+ wasm$1.newacmeorder_authorizations(retptr, this.__wbg_ptr);
2566
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2567
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2568
+ var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2569
+ wasm$1.__wbindgen_free(r0, r1 * 4);
2570
+ return v1;
2571
+ }
2572
+ finally {
2573
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2574
+ }
2591
2575
  }
2592
2576
  /**
2577
+ * Contains raw JSON data of this order. This is parsed by the underlying Rust library hence should not be accessed
2593
2578
  * @returns {Uint8Array}
2594
2579
  */
2595
2580
  get delegate() {
2596
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
2597
- return takeObject(ret);
2598
- }
2599
- /**
2600
- * @returns {Array<any>}
2601
- */
2602
- get authorizations() {
2603
- const ret = wasm$1.newacmeorder_authorizations(this.__wbg_ptr);
2604
- return takeObject(ret);
2581
+ try {
2582
+ const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2583
+ wasm$1.__wbg_get_acmechallenge_delegate(retptr, this.__wbg_ptr);
2584
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
2585
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
2586
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
2587
+ wasm$1.__wbindgen_free(r0, r1 * 1);
2588
+ return v1;
2589
+ }
2590
+ finally {
2591
+ wasm$1.__wbindgen_add_to_stack_pointer(16);
2592
+ }
2605
2593
  }
2606
2594
  }
2607
2595
  /**
@@ -2657,7 +2645,7 @@ class ProposalBundle {
2657
2645
  * @returns {Uint8Array}
2658
2646
  */
2659
2647
  get proposal() {
2660
- const ret = wasm$1.acmechallenge_delegate(this.__wbg_ptr);
2648
+ const ret = wasm$1.commitbundle_commit(this.__wbg_ptr);
2661
2649
  return takeObject(ret);
2662
2650
  }
2663
2651
  /**
@@ -2705,7 +2693,7 @@ class ProteusAutoPrekeyBundle {
2705
2693
  get pkb() {
2706
2694
  try {
2707
2695
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2708
- wasm$1.__wbg_get_proteusautoprekeybundle_pkb(retptr, this.__wbg_ptr);
2696
+ wasm$1.__wbg_get_acmechallenge_delegate(retptr, this.__wbg_ptr);
2709
2697
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2710
2698
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2711
2699
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
@@ -2827,7 +2815,7 @@ class WireIdentity {
2827
2815
  let deferred1_1;
2828
2816
  try {
2829
2817
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2830
- wasm$1.acmedirectory_newNonce(retptr, this.__wbg_ptr);
2818
+ wasm$1.wireidentity_client_id(retptr, this.__wbg_ptr);
2831
2819
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2832
2820
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2833
2821
  deferred1_0 = r0;
@@ -2847,7 +2835,7 @@ class WireIdentity {
2847
2835
  let deferred1_1;
2848
2836
  try {
2849
2837
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2850
- wasm$1.acmechallenge_url(retptr, this.__wbg_ptr);
2838
+ wasm$1.wireidentity_handle(retptr, this.__wbg_ptr);
2851
2839
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2852
2840
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2853
2841
  deferred1_0 = r0;
@@ -2867,7 +2855,7 @@ class WireIdentity {
2867
2855
  let deferred1_1;
2868
2856
  try {
2869
2857
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2870
- wasm$1.acmechallenge_target(retptr, this.__wbg_ptr);
2858
+ wasm$1.wireidentity_display_name(retptr, this.__wbg_ptr);
2871
2859
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2872
2860
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2873
2861
  deferred1_0 = r0;
@@ -2887,7 +2875,7 @@ class WireIdentity {
2887
2875
  let deferred1_1;
2888
2876
  try {
2889
2877
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2890
- wasm$1.acmedirectory_revokeCert(retptr, this.__wbg_ptr);
2878
+ wasm$1.wireidentity_domain(retptr, this.__wbg_ptr);
2891
2879
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2892
2880
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2893
2881
  deferred1_0 = r0;
@@ -2951,19 +2939,42 @@ async function __wbg_load(module, imports) {
2951
2939
  function __wbg_get_imports() {
2952
2940
  const imports = {};
2953
2941
  imports.wbg = {};
2954
- imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
2955
- const ret = getObject(arg0);
2942
+ imports.wbg.__wbg_new_b51585de1b234aff = function () {
2943
+ const ret = new Object();
2944
+ return addHeapObject(ret);
2945
+ };
2946
+ imports.wbg.__wbg_new_56693dbed0c32988 = function () {
2947
+ const ret = new Map();
2948
+ return addHeapObject(ret);
2949
+ };
2950
+ imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
2951
+ const ret = getStringFromWasm0(arg0, arg1);
2952
+ return addHeapObject(ret);
2953
+ };
2954
+ imports.wbg.__wbg_set_bedc3d02d0f05eb0 = function (arg0, arg1, arg2) {
2955
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2956
2956
  return addHeapObject(ret);
2957
2957
  };
2958
2958
  imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
2959
2959
  takeObject(arg0);
2960
2960
  };
2961
+ imports.wbg.__wbindgen_is_string = function (arg0) {
2962
+ const ret = typeof (getObject(arg0)) === 'string';
2963
+ return ret;
2964
+ };
2965
+ imports.wbg.__wbg_set_bd72c078edfa51ad = function (arg0, arg1, arg2) {
2966
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2967
+ };
2968
+ imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
2969
+ const ret = getObject(arg0);
2970
+ return addHeapObject(ret);
2971
+ };
2961
2972
  imports.wbg.__wbindgen_is_object = function (arg0) {
2962
2973
  const val = getObject(arg0);
2963
2974
  const ret = typeof (val) === 'object' && val !== null;
2964
2975
  return ret;
2965
2976
  };
2966
- imports.wbg.__wbg_getwithrefkey_5e6d9547403deab8 = function (arg0, arg1) {
2977
+ imports.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea = function (arg0, arg1) {
2967
2978
  const ret = getObject(arg0)[getObject(arg1)];
2968
2979
  return addHeapObject(ret);
2969
2980
  };
@@ -2989,10 +3000,6 @@ function __wbg_get_imports() {
2989
3000
  const ret = getObject(arg0).length;
2990
3001
  return ret;
2991
3002
  };
2992
- imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
2993
- const ret = getStringFromWasm0(arg0, arg1);
2994
- return addHeapObject(ret);
2995
- };
2996
3003
  imports.wbg.__wbg_get_fc26906e5ae1ea85 = function () {
2997
3004
  return handleError(function (arg0, arg1) {
2998
3005
  const ret = getObject(arg0).get(getObject(arg1));
@@ -3015,10 +3022,6 @@ function __wbg_get_imports() {
3015
3022
  const ret = getObject(arg0).length;
3016
3023
  return ret;
3017
3024
  };
3018
- imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
3019
- const ret = FfiWireE2EIdentity.__wrap(arg0);
3020
- return addHeapObject(ret);
3021
- };
3022
3025
  imports.wbg.__wbg_call_01734de55d61e11d = function () {
3023
3026
  return handleError(function (arg0, arg1, arg2) {
3024
3027
  const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
@@ -3033,8 +3036,12 @@ function __wbg_get_imports() {
3033
3036
  const ret = arg0;
3034
3037
  return addHeapObject(ret);
3035
3038
  };
3036
- imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
3037
- const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
3039
+ imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
3040
+ const ret = BigInt.asUintN(64, arg0);
3041
+ return addHeapObject(ret);
3042
+ };
3043
+ imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
3044
+ const ret = FfiWireE2EIdentity.__wrap(arg0);
3038
3045
  return addHeapObject(ret);
3039
3046
  };
3040
3047
  imports.wbg.__wbg_new_898a68150f225f2e = function () {
@@ -3045,26 +3052,11 @@ function __wbg_get_imports() {
3045
3052
  const ret = getObject(arg0).push(getObject(arg1));
3046
3053
  return ret;
3047
3054
  };
3048
- imports.wbg.__wbg_new_b51585de1b234aff = function () {
3049
- const ret = new Object();
3050
- return addHeapObject(ret);
3051
- };
3052
- imports.wbg.__wbg_set_841ac57cff3d672b = function (arg0, arg1, arg2) {
3053
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
3054
- };
3055
- imports.wbg.__wbg_new_56693dbed0c32988 = function () {
3056
- const ret = new Map();
3057
- return addHeapObject(ret);
3058
- };
3059
- imports.wbg.__wbg_set_bedc3d02d0f05eb0 = function (arg0, arg1, arg2) {
3060
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
3061
- return addHeapObject(ret);
3062
- };
3063
3055
  imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
3064
3056
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
3065
3057
  };
3066
- imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
3067
- const ret = BigInt.asUintN(64, arg0);
3058
+ imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
3059
+ const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
3068
3060
  return addHeapObject(ret);
3069
3061
  };
3070
3062
  imports.wbg.__wbg_new_d258248ed531ff54 = function (arg0, arg1) {
@@ -3190,7 +3182,7 @@ function __wbg_get_imports() {
3190
3182
  const a = state0.a;
3191
3183
  state0.a = 0;
3192
3184
  try {
3193
- return __wbg_adapter_312(a, state0.b, arg0, arg1);
3185
+ return __wbg_adapter_308(a, state0.b, arg0, arg1);
3194
3186
  }
3195
3187
  finally {
3196
3188
  state0.a = a;
@@ -3203,10 +3195,6 @@ function __wbg_get_imports() {
3203
3195
  state0.a = state0.b = 0;
3204
3196
  }
3205
3197
  };
3206
- imports.wbg.__wbindgen_is_string = function (arg0) {
3207
- const ret = typeof (getObject(arg0)) === 'string';
3208
- return ret;
3209
- };
3210
3198
  imports.wbg.__wbg_reject_7bd6ac9617013c02 = function (arg0) {
3211
3199
  const ret = Promise.reject(getObject(arg0));
3212
3200
  return addHeapObject(ret);
@@ -3334,6 +3322,15 @@ function __wbg_get_imports() {
3334
3322
  return addHeapObject(ret);
3335
3323
  }, arguments);
3336
3324
  };
3325
+ imports.wbg.__wbg_subarray_13db269f57aa838d = function (arg0, arg1, arg2) {
3326
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3327
+ return addHeapObject(ret);
3328
+ };
3329
+ imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function () {
3330
+ return handleError(function (arg0, arg1) {
3331
+ getObject(arg0).getRandomValues(getObject(arg1));
3332
+ }, arguments);
3333
+ };
3337
3334
  imports.wbg.__wbindgen_memory = function () {
3338
3335
  const ret = wasm$1.memory;
3339
3336
  return addHeapObject(ret);
@@ -3351,15 +3348,6 @@ function __wbg_get_imports() {
3351
3348
  getObject(arg0).randomFillSync(takeObject(arg1));
3352
3349
  }, arguments);
3353
3350
  };
3354
- imports.wbg.__wbg_subarray_13db269f57aa838d = function (arg0, arg1, arg2) {
3355
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
3356
- return addHeapObject(ret);
3357
- };
3358
- imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function () {
3359
- return handleError(function (arg0, arg1) {
3360
- getObject(arg0).getRandomValues(getObject(arg1));
3361
- }, arguments);
3362
- };
3363
3351
  imports.wbg.__wbg_crypto_c48a774b022d20ac = function (arg0) {
3364
3352
  const ret = getObject(arg0).crypto;
3365
3353
  return addHeapObject(ret);
@@ -3586,7 +3574,7 @@ function __wbg_get_imports() {
3586
3574
  const ret = Object.entries(getObject(arg0));
3587
3575
  return addHeapObject(ret);
3588
3576
  };
3589
- imports.wbg.__wbg_String_88810dfeb4021902 = function (arg0, arg1) {
3577
+ imports.wbg.__wbg_String_4370c5505c674d30 = function (arg0, arg1) {
3590
3578
  const ret = String(getObject(arg1));
3591
3579
  const ptr1 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
3592
3580
  const len1 = WASM_VECTOR_LEN;
@@ -3643,12 +3631,12 @@ function __wbg_get_imports() {
3643
3631
  return addHeapObject(ret);
3644
3632
  }, arguments);
3645
3633
  };
3646
- imports.wbg.__wbindgen_closure_wrapper1725 = function (arg0, arg1, arg2) {
3647
- const ret = makeMutClosure(arg0, arg1, 149, __wbg_adapter_52);
3634
+ imports.wbg.__wbindgen_closure_wrapper1743 = function (arg0, arg1, arg2) {
3635
+ const ret = makeMutClosure(arg0, arg1, 146, __wbg_adapter_52);
3648
3636
  return addHeapObject(ret);
3649
3637
  };
3650
- imports.wbg.__wbindgen_closure_wrapper4849 = function (arg0, arg1, arg2) {
3651
- const ret = makeMutClosure(arg0, arg1, 149, __wbg_adapter_55);
3638
+ imports.wbg.__wbindgen_closure_wrapper4858 = function (arg0, arg1, arg2) {
3639
+ const ret = makeMutClosure(arg0, arg1, 146, __wbg_adapter_55);
3652
3640
  return addHeapObject(ret);
3653
3641
  };
3654
3642
  return imports;
@@ -3715,7 +3703,7 @@ var exports = /*#__PURE__*/Object.freeze({
3715
3703
  initSync: initSync
3716
3704
  });
3717
3705
 
3718
- const wasm_path = "assets/core_crypto_ffi-d9ea5643.wasm";
3706
+ const wasm_path = "assets/core_crypto_ffi-105754e9.wasm";
3719
3707
 
3720
3708
 
3721
3709
  var wasm = async (opt = {}) => {
@@ -3964,14 +3952,14 @@ class CoreCrypto {
3964
3952
  * });
3965
3953
  * ````
3966
3954
  */
3967
- static async init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed }) {
3955
+ static async init({ databaseName, key, clientId, wasmFilePath, ciphersuites, entropySeed, nbKeyPackage, }) {
3968
3956
  if (!__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module)) {
3969
3957
  const wasmImportArgs = wasmFilePath ? { importHook: () => wasmFilePath } : undefined;
3970
3958
  const exports = (await wasm(wasmImportArgs));
3971
3959
  __classPrivateFieldSet(this, _a, exports, "f", _CoreCrypto_module);
3972
3960
  }
3973
3961
  let cs = ciphersuites.map(cs => cs.valueOf());
3974
- const cc = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto._internal_new(databaseName, key, clientId, Uint16Array.of(...cs), entropySeed));
3962
+ const cc = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto._internal_new(databaseName, key, clientId, Uint16Array.of(...cs), entropySeed, nbKeyPackage));
3975
3963
  return new this(cc);
3976
3964
  }
3977
3965
  /**
@@ -3981,14 +3969,14 @@ class CoreCrypto {
3981
3969
  * Use this clientId to initialize MLS with {@link CoreCrypto.mlsInit}.
3982
3970
  * @param params - {@link CoreCryptoDeferredParams}
3983
3971
  */
3984
- static async deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath }) {
3972
+ static async deferredInit({ databaseName, key, ciphersuites, entropySeed, wasmFilePath, nbKeyPackage, }) {
3985
3973
  if (!__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module)) {
3986
3974
  const wasmImportArgs = wasmFilePath ? { importHook: () => wasmFilePath } : undefined;
3987
3975
  const exports = (await wasm(wasmImportArgs));
3988
3976
  __classPrivateFieldSet(this, _a, exports, "f", _CoreCrypto_module);
3989
3977
  }
3990
3978
  let cs = ciphersuites.map(cs => cs.valueOf());
3991
- const cc = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.deferred_init(databaseName, key, Uint16Array.of(...cs), entropySeed));
3979
+ const cc = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _a, "f", _CoreCrypto_module).CoreCrypto.deferred_init(databaseName, key, Uint16Array.of(...cs), entropySeed, nbKeyPackage));
3992
3980
  return new this(cc);
3993
3981
  }
3994
3982
  /**
@@ -3996,10 +3984,11 @@ class CoreCrypto {
3996
3984
  *
3997
3985
  * @param clientId - {@link CoreCryptoParams#clientId} but required
3998
3986
  * @param ciphersuites - All the ciphersuites supported by this MLS client
3987
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
3999
3988
  */
4000
- async mlsInit(clientId, ciphersuites) {
3989
+ async mlsInit(clientId, ciphersuites, nbKeyPackage) {
4001
3990
  let cs = ciphersuites.map(cs => cs.valueOf());
4002
- return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").mls_init(clientId, Uint16Array.of(...cs)));
3991
+ return await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").mls_init(clientId, Uint16Array.of(...cs), nbKeyPackage));
4003
3992
  }
4004
3993
  /**
4005
3994
  * Generates a MLS KeyPair/CredentialBundle with a temporary, random client ID.
@@ -4779,7 +4768,7 @@ class CoreCrypto {
4779
4768
  * Creates an enrollment instance with private key material you can use in order to fetch
4780
4769
  * a new x509 certificate from the acme server.
4781
4770
  *
4782
- * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4771
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `t6wRpI8BRSeviBwwiFp5MQ:6add501bacd1d90e@example.com`
4783
4772
  * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
4784
4773
  * @param handle - user handle e.g. `alice.smith.qa@example.com`
4785
4774
  * @param expiryDays - generated x509 certificate expiry
@@ -4794,7 +4783,7 @@ class CoreCrypto {
4794
4783
  * Generates an E2EI enrollment instance for a "regular" client (with a Basic credential) willing to migrate to E2EI.
4795
4784
  * Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
4796
4785
  *
4797
- * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4786
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `t6wRpI8BRSeviBwwiFp5MQ:6add501bacd1d90e@example.com`
4798
4787
  * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
4799
4788
  * @param handle - user handle e.g. `alice.smith.qa@example.com`
4800
4789
  * @param expiryDays - generated x509 certificate expiry
@@ -4811,7 +4800,7 @@ class CoreCrypto {
4811
4800
  * has been revoked. It lets you change the DisplayName or the handle
4812
4801
  * if you need to. Once the enrollment is finished, use the instance in {@link CoreCrypto.e2eiRotateAll} to do the rotation.
4813
4802
  *
4814
- * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4803
+ * @param clientId - client identifier with user b64Url encoded & clientId hex encoded e.g. `t6wRpI8BRSeviBwwiFp5MQ:6add501bacd1d90e@example.com`
4815
4804
  * @param expiryDays - generated x509 certificate expiry
4816
4805
  * @param ciphersuite - for generating signing key material
4817
4806
  * @param displayName - human-readable name displayed in the application e.g. `Smith, Alice M (QA)`
@@ -4828,10 +4817,11 @@ class CoreCrypto {
4828
4817
  *
4829
4818
  * @param enrollment - the enrollment instance used to fetch the certificates
4830
4819
  * @param certificateChain - the raw response from ACME server
4820
+ * @param nbKeyPackage - number of initial KeyPackage to create when initializing the client
4831
4821
  * @returns a MlsClient initialized with only a x509 credential
4832
4822
  */
4833
- async e2eiMlsInitOnly(enrollment, certificateChain) {
4834
- return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_mls_init_only(enrollment.inner(), certificateChain);
4823
+ async e2eiMlsInitOnly(enrollment, certificateChain, nbKeyPackage) {
4824
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_mls_init_only(enrollment.inner(), certificateChain, nbKeyPackage);
4835
4825
  }
4836
4826
  /**
4837
4827
  * Creates a commit in all local conversations for changing the credential. Requires first