@wireapp/core-crypto 0.7.0-rc.3 → 0.7.0-rc.4

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": "0.7.0-rc.3",
3
+ "version": "0.7.0-rc.4",
4
4
  "description": "CoreCrypto bindings for the Web",
5
5
  "type": "module",
6
6
  "module": "platforms/web/corecrypto.js",
@@ -520,12 +520,12 @@ export declare class CoreCrypto {
520
520
  /** @hidden */
521
521
  private constructor();
522
522
  /**
523
- * If this returns > 1 you **cannot** call {@link CoreCrypto.wipe} or {@link CoreCrypto.close} as they will produce an error because of the
523
+ * If this returns `true` you **cannot** call {@link CoreCrypto.wipe} or {@link CoreCrypto.close} as they will produce an error because of the
524
524
  * outstanding references that were detected.
525
525
  *
526
526
  * @returns the count of strong refs for this CoreCrypto instance
527
527
  */
528
- strongRefCount(): number;
528
+ isLocked(): boolean;
529
529
  /**
530
530
  * Wipes the {@link CoreCrypto} backing storage (i.e. {@link https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API | IndexedDB} database)
531
531
  *
@@ -934,13 +934,22 @@ export declare class CoreCrypto {
934
934
  /**
935
935
  * Creates an enrollment instance with private key material you can use in order to fetch
936
936
  * a new x509 certificate from the acme server.
937
- * Make sure to call {@link WireE2eIdentity.free} to dispose this instance and its associated
938
- * keying material.
939
937
  *
938
+ * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
939
+ * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
940
+ * @param handle user handle e.g. `alice.smith.qa@example.com`
941
+ * @param expiryDays generated x509 certificate expiry
940
942
  * @param ciphersuite - For generating signing key material. Only {@link Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519} is supported currently
941
943
  * @returns The new {@link WireE2eIdentity} object
942
944
  */
943
- newAcmeEnrollment(ciphersuite?: Ciphersuite): Promise<WireE2eIdentity>;
945
+ newAcmeEnrollment(clientId: string, displayName: string, handle: string, expiryDays: number, ciphersuite?: Ciphersuite): Promise<WireE2eIdentity>;
946
+ /**
947
+ * Parses the ACME server response from the endpoint fetching x509 certificates and uses it to initialize the MLS client with a certificate
948
+ *
949
+ * @param e2ei - the enrollment instance used to fetch the certificates
950
+ * @param certificateChain - the raw response from ACME server
951
+ */
952
+ e2eiMlsInit(e2ei: WireE2eIdentity, certificateChain: string): Promise<void>;
944
953
  /**
945
954
  * Returns the current version of {@link CoreCrypto}
946
955
  *
@@ -949,13 +958,15 @@ export declare class CoreCrypto {
949
958
  static version(): string;
950
959
  }
951
960
  type JsonRawData = Uint8Array;
952
- type AcmeAccount = Uint8Array;
953
- type AcmeOrder = Uint8Array;
954
961
  export declare class WireE2eIdentity {
955
962
  #private;
956
963
  /** @hidden */
957
964
  constructor(e2ei: unknown);
958
965
  free(): void;
966
+ /**
967
+ * Should only be used internally
968
+ */
969
+ inner(): unknown;
959
970
  /**
960
971
  * Parses the response from `GET /acme/{provisioner-name}/directory`.
961
972
  * Use this {@link AcmeDirectory} in the next step to fetch the first nonce from the acme server. Use
@@ -969,30 +980,23 @@ export declare class WireE2eIdentity {
969
980
  * For creating a new acme account. This returns a signed JWS-alike request body to send to
970
981
  * `POST /acme/{provisioner-name}/new-account`.
971
982
  *
972
- * @param directory you got from {@link directoryResponse}
973
983
  * @param previousNonce you got from calling `HEAD {@link AcmeDirectory.newNonce}`
974
984
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
975
985
  */
976
- newAccountRequest(directory: AcmeDirectory, previousNonce: string): JsonRawData;
986
+ newAccountRequest(previousNonce: string): JsonRawData;
977
987
  /**
978
988
  * Parses the response from `POST /acme/{provisioner-name}/new-account`.
979
989
  * @param account HTTP response body
980
990
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
981
991
  */
982
- newAccountResponse(account: JsonRawData): AcmeAccount;
992
+ newAccountResponse(account: JsonRawData): void;
983
993
  /**
984
994
  * Creates a new acme order for the handle (userId + display name) and the clientId.
985
995
  *
986
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
987
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
988
- * @param handle user handle e.g. `alice.smith.qa@example.com`
989
- * @param expiryDays generated x509 certificate expiry
990
- * @param directory you got from {@link directoryResponse}
991
- * @param account you got from {@link newAccountResponse}
992
996
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-account`
993
997
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
994
998
  */
995
- newOrderRequest(displayName: string, clientId: string, handle: string, expiryDays: number, directory: AcmeDirectory, account: AcmeAccount, previousNonce: string): JsonRawData;
999
+ newOrderRequest(previousNonce: string): JsonRawData;
996
1000
  /**
997
1001
  * Parses the response from `POST /acme/{provisioner-name}/new-order`.
998
1002
  *
@@ -1004,12 +1008,11 @@ export declare class WireE2eIdentity {
1004
1008
  * Creates a new authorization request.
1005
1009
  *
1006
1010
  * @param url one of the URL in new order's authorizations (use {@link NewAcmeOrder.authorizations} from {@link newOrderResponse})
1007
- * @param account you got from {@link newAccountResponse}
1008
1011
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-order` (or from the
1009
1012
  * previous to this method if you are creating the second authorization)
1010
1013
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
1011
1014
  */
1012
- newAuthzRequest(url: string, account: AcmeAccount, previousNonce: string): JsonRawData;
1015
+ newAuthzRequest(url: string, previousNonce: string): JsonRawData;
1013
1016
  /**
1014
1017
  * Parses the response from `POST /acme/{provisioner-name}/authz/{authz-id}`
1015
1018
  *
@@ -1026,32 +1029,25 @@ export declare class WireE2eIdentity {
1026
1029
  * {@link https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_clients__cid__access_token} on wire-server.
1027
1030
  *
1028
1031
  * @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}
1029
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
1030
- * @param dpopChallenge you found after {@link newAuthzResponse}
1031
1032
  * @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}
1032
- * @param expiryDays token expiry in days
1033
1033
  */
1034
- createDpopToken(accessTokenUrl: string, clientId: string, dpopChallenge: AcmeChallenge, backendNonce: string, expiryDays: number): string;
1034
+ createDpopToken(accessTokenUrl: string, backendNonce: string): Uint8Array;
1035
1035
  /**
1036
1036
  * Creates a new challenge request for Wire Dpop challenge.
1037
1037
  *
1038
1038
  * @param accessToken returned by wire-server from https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_clients__cid__access_token
1039
- * @param dpopChallenge you found after {@link newAuthzResponse}
1040
- * @param account you found after {@link newAccountResponse}
1041
1039
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
1042
1040
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1043
1041
  */
1044
- newDpopChallengeRequest(accessToken: string, dpopChallenge: AcmeChallenge, account: AcmeAccount, previousNonce: string): JsonRawData;
1042
+ newDpopChallengeRequest(accessToken: string, previousNonce: string): JsonRawData;
1045
1043
  /**
1046
1044
  * Creates a new challenge request for Wire Oidc challenge.
1047
1045
  *
1048
1046
  * @param idToken you get back from Identity Provider
1049
- * @param oidcChallenge you found after {@link newAuthzResponse}
1050
- * @param account you found after {@link newAccountResponse}
1051
1047
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
1052
1048
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
1053
1049
  */
1054
- newOidcChallengeRequest(idToken: string, oidcChallenge: AcmeChallenge, account: AcmeAccount, previousNonce: string): JsonRawData;
1050
+ newOidcChallengeRequest(idToken: string, previousNonce: string): JsonRawData;
1055
1051
  /**
1056
1052
  * Parses the response from `POST /acme/{provisioner-name}/challenge/{challenge-id}`.
1057
1053
  *
@@ -1067,46 +1063,36 @@ export declare class WireE2eIdentity {
1067
1063
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
1068
1064
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1069
1065
  */
1070
- checkOrderRequest(orderUrl: string, account: AcmeAccount, previousNonce: string): JsonRawData;
1066
+ checkOrderRequest(orderUrl: string, previousNonce: string): JsonRawData;
1071
1067
  /**
1072
1068
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}`.
1073
1069
  *
1074
1070
  * @param order HTTP response body
1075
1071
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1076
1072
  */
1077
- checkOrderResponse(order: JsonRawData): AcmeOrder;
1073
+ checkOrderResponse(order: JsonRawData): void;
1078
1074
  /**
1079
1075
  * Final step before fetching the certificate.
1080
1076
  *
1081
1077
  * @param order - order you got from {@link checkOrderResponse}
1082
- * @param account - account you found after {@link newAccountResponse}
1083
1078
  * @param previousNonce - `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
1084
1079
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1085
1080
  */
1086
- finalizeRequest(order: AcmeOrder, account: AcmeAccount, previousNonce: string): JsonRawData;
1081
+ finalizeRequest(previousNonce: string): JsonRawData;
1087
1082
  /**
1088
1083
  * Parses the response from `POST /acme/{provisioner-name}/order/{order-id}/finalize`.
1089
1084
  *
1090
1085
  * @param finalize HTTP response body
1091
1086
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1092
1087
  */
1093
- finalizeResponse(finalize: JsonRawData): AcmeFinalize;
1088
+ finalizeResponse(finalize: JsonRawData): void;
1094
1089
  /**
1095
1090
  * Creates a request for finally fetching the x509 certificate.
1096
1091
  *
1097
- * @param finalize you got from {@link finalizeResponse}
1098
- * @param account you got from {@link newAccountResponse}
1099
1092
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}/finalize`
1100
1093
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
1101
1094
  */
1102
- certificateRequest(finalize: AcmeFinalize, account: AcmeAccount, previousNonce: string): JsonRawData;
1103
- /**
1104
- * Parses the response from `POST /acme/{provisioner-name}/certificate/{certificate-id}`.
1105
- *
1106
- * @param certificateChain HTTP string response body
1107
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
1108
- */
1109
- certificateResponse(certificateChain: string): Uint8Array[];
1095
+ certificateRequest(previousNonce: string): JsonRawData;
1110
1096
  }
1111
1097
  /**
1112
1098
  * Holds URLs of all the standard ACME endpoint supported on an ACME server.
@@ -1166,13 +1152,13 @@ export interface NewAcmeAuthz {
1166
1152
  *
1167
1153
  * @readonly
1168
1154
  */
1169
- wireDpopChallenge: AcmeChallenge | null;
1155
+ wireDpopChallenge?: AcmeChallenge;
1170
1156
  /**
1171
1157
  * Challenge for the userId and displayName
1172
1158
  *
1173
1159
  * @readonly
1174
1160
  */
1175
- wireOidcChallenge: AcmeChallenge | null;
1161
+ wireOidcChallenge?: AcmeChallenge;
1176
1162
  }
1177
1163
  /**
1178
1164
  * For creating a challenge
@@ -1192,23 +1178,5 @@ export interface AcmeChallenge {
1192
1178
  */
1193
1179
  url: string;
1194
1180
  }
1195
- /**
1196
- * Result from finalize.
1197
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
1198
- */
1199
- export interface AcmeFinalize {
1200
- /**
1201
- * Contains raw JSON data of this finalize. This is parsed by the underlying Rust library hence should not be accessed
1202
- *
1203
- * @readonly
1204
- */
1205
- delegate: Uint8Array;
1206
- /**
1207
- * URL of to use for the last request to fetch the x509 certificate
1208
- *
1209
- * @readonly
1210
- */
1211
- certificateUrl: string;
1212
- }
1213
1181
 
1214
1182
  export {};
@@ -226,12 +226,12 @@ function makeMutClosure(arg0, arg1, dtor, f) {
226
226
  return real;
227
227
  }
228
228
  function __wbg_adapter_52(arg0, arg1, arg2) {
229
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h52d25f5c9b3d3ff2(arg0, arg1, addHeapObject(arg2));
229
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hcd81a8436ed0ce82(arg0, arg1, addHeapObject(arg2));
230
230
  }
231
231
  function __wbg_adapter_55(arg0, arg1, arg2) {
232
232
  try {
233
233
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
234
- wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf21a7c6a12593e32(retptr, arg0, arg1, addHeapObject(arg2));
234
+ wasm$1._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h24e8da7fa5a69ec8(retptr, arg0, arg1, addHeapObject(arg2));
235
235
  var r0 = getInt32Memory0()[retptr / 4 + 0];
236
236
  var r1 = getInt32Memory0()[retptr / 4 + 1];
237
237
  if (r1) {
@@ -270,15 +270,6 @@ function passArray8ToWasm0(arg, malloc) {
270
270
  WASM_VECTOR_LEN = arg.length;
271
271
  return ptr;
272
272
  }
273
- function getArrayJsValueFromWasm0(ptr, len) {
274
- const mem = getUint32Memory0();
275
- const slice = mem.subarray(ptr / 4, ptr / 4 + len);
276
- const result = [];
277
- for (let i = 0; i < slice.length; i++) {
278
- result.push(takeObject(slice[i]));
279
- }
280
- return result;
281
- }
282
273
  function getArrayU8FromWasm0(ptr, len) {
283
274
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
284
275
  }
@@ -290,8 +281,8 @@ function handleError(f, args) {
290
281
  wasm$1.__wbindgen_exn_store(addHeapObject(e));
291
282
  }
292
283
  }
293
- function __wbg_adapter_282(arg0, arg1, arg2, arg3) {
294
- wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h48b463a50f27b62f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
284
+ function __wbg_adapter_279(arg0, arg1, arg2, arg3) {
285
+ wasm$1.wasm_bindgen__convert__closures__invoke2_mut__h4a304d04c926e9b8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
295
286
  }
296
287
  /**
297
288
  * see [core_crypto::prelude::MlsWirePolicy]
@@ -427,10 +418,10 @@ class AcmeDirectory {
427
418
  /**
428
419
  * @returns {string}
429
420
  */
430
- get new_nonce() {
421
+ get newNonce() {
431
422
  try {
432
423
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
433
- wasm$1.acmedirectory_new_nonce(retptr, this.ptr);
424
+ wasm$1.acmedirectory_newNonce(retptr, this.ptr);
434
425
  var r0 = getInt32Memory0()[retptr / 4 + 0];
435
426
  var r1 = getInt32Memory0()[retptr / 4 + 1];
436
427
  return getStringFromWasm0(r0, r1);
@@ -443,7 +434,7 @@ class AcmeDirectory {
443
434
  /**
444
435
  * @returns {string}
445
436
  */
446
- get new_account() {
437
+ get newAccount() {
447
438
  try {
448
439
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
449
440
  wasm$1.acmechallenge_url(retptr, this.ptr);
@@ -459,62 +450,10 @@ class AcmeDirectory {
459
450
  /**
460
451
  * @returns {string}
461
452
  */
462
- get new_order() {
463
- try {
464
- const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
465
- wasm$1.acmedirectory_new_order(retptr, this.ptr);
466
- var r0 = getInt32Memory0()[retptr / 4 + 0];
467
- var r1 = getInt32Memory0()[retptr / 4 + 1];
468
- return getStringFromWasm0(r0, r1);
469
- }
470
- finally {
471
- wasm$1.__wbindgen_add_to_stack_pointer(16);
472
- wasm$1.__wbindgen_free(r0, r1);
473
- }
474
- }
475
- }
476
- /**
477
- * See [core_crypto::e2e_identity::types::E2eiAcmeFinalize]
478
- */
479
- class AcmeFinalize {
480
- static __wrap(ptr) {
481
- const obj = Object.create(AcmeFinalize.prototype);
482
- obj.ptr = ptr;
483
- return obj;
484
- }
485
- __destroy_into_raw() {
486
- const ptr = this.ptr;
487
- this.ptr = 0;
488
- return ptr;
489
- }
490
- free() {
491
- const ptr = this.__destroy_into_raw();
492
- wasm$1.__wbg_acmefinalize_free(ptr);
493
- }
494
- /**
495
- * @param {Uint8Array} delegate
496
- * @param {string} certificate_url
497
- */
498
- constructor(delegate, certificate_url) {
499
- const ptr0 = passStringToWasm0(certificate_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
500
- const len0 = WASM_VECTOR_LEN;
501
- const ret = wasm$1.acmechallenge_new(addHeapObject(delegate), ptr0, len0);
502
- return AcmeFinalize.__wrap(ret);
503
- }
504
- /**
505
- * @returns {Uint8Array}
506
- */
507
- get delegate() {
508
- const ret = wasm$1.acmechallenge_delegate(this.ptr);
509
- return takeObject(ret);
510
- }
511
- /**
512
- * @returns {string}
513
- */
514
- get certificate_url() {
453
+ get newOrder() {
515
454
  try {
516
455
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
517
- wasm$1.acmechallenge_url(retptr, this.ptr);
456
+ wasm$1.acmedirectory_newOrder(retptr, this.ptr);
518
457
  var r0 = getInt32Memory0()[retptr / 4 + 0];
519
458
  var r1 = getInt32Memory0()[retptr / 4 + 1];
520
459
  return getStringFromWasm0(r0, r1);
@@ -734,11 +673,11 @@ let CoreCrypto$1 = class CoreCrypto {
734
673
  }
735
674
  /**
736
675
  * Returns the Arc strong ref count
737
- * @returns {number}
676
+ * @returns {boolean}
738
677
  */
739
- strong_ref_count() {
740
- const ret = wasm$1.corecrypto_strong_ref_count(this.ptr);
741
- return ret >>> 0;
678
+ has_outstanding_refs() {
679
+ const ret = wasm$1.corecrypto_has_outstanding_refs(this.ptr);
680
+ return ret !== 0;
742
681
  }
743
682
  /**
744
683
  * Returns: [`WasmCryptoResult<()>`]
@@ -1472,12 +1411,38 @@ let CoreCrypto$1 = class CoreCrypto {
1472
1411
  return takeObject(ret);
1473
1412
  }
1474
1413
  /**
1414
+ * Returns: [`WasmCryptoResult<WireE2eIdentity>`]
1415
+ *
1475
1416
  * see [core_crypto::mls::MlsCentral::new_acme_enrollment]
1417
+ * @param {string} client_id
1418
+ * @param {string} display_name
1419
+ * @param {string} handle
1420
+ * @param {number} expiry_days
1476
1421
  * @param {number} ciphersuite
1477
- * @returns {Promise<FfiWireE2EIdentity>}
1422
+ * @returns {Promise<any>}
1478
1423
  */
1479
- new_acme_enrollment(ciphersuite) {
1480
- const ret = wasm$1.corecrypto_new_acme_enrollment(this.ptr, ciphersuite);
1424
+ new_acme_enrollment(client_id, display_name, handle, expiry_days, ciphersuite) {
1425
+ const ptr0 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1426
+ const len0 = WASM_VECTOR_LEN;
1427
+ const ptr1 = passStringToWasm0(display_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1428
+ const len1 = WASM_VECTOR_LEN;
1429
+ const ptr2 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1430
+ const len2 = WASM_VECTOR_LEN;
1431
+ const ret = wasm$1.corecrypto_new_acme_enrollment(this.ptr, ptr0, len0, ptr1, len1, ptr2, len2, expiry_days, ciphersuite);
1432
+ return takeObject(ret);
1433
+ }
1434
+ /**
1435
+ * see [core_crypto::mls::MlsCentral::e2ei_mls_init]
1436
+ * @param {FfiWireE2EIdentity} e2ei
1437
+ * @param {string} certificate_chain
1438
+ * @returns {Promise<any>}
1439
+ */
1440
+ e2ei_mls_init(e2ei, certificate_chain) {
1441
+ _assertClass(e2ei, FfiWireE2EIdentity);
1442
+ var ptr0 = e2ei.__destroy_into_raw();
1443
+ const ptr1 = passStringToWasm0(certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1444
+ const len1 = WASM_VECTOR_LEN;
1445
+ const ret = wasm$1.corecrypto_e2ei_mls_init(this.ptr, ptr0, ptr1, len1);
1481
1446
  return takeObject(ret);
1482
1447
  }
1483
1448
  };
@@ -1621,7 +1586,7 @@ class FfiWireE2EIdentity {
1621
1586
  /**
1622
1587
  * See [core_crypto::e2e_identity::WireE2eIdentity::directory_response]
1623
1588
  * @param {Uint8Array} directory
1624
- * @returns {any}
1589
+ * @returns {AcmeDirectory}
1625
1590
  */
1626
1591
  directory_response(directory) {
1627
1592
  try {
@@ -1635,7 +1600,7 @@ class FfiWireE2EIdentity {
1635
1600
  if (r2) {
1636
1601
  throw takeObject(r1);
1637
1602
  }
1638
- return takeObject(r0);
1603
+ return AcmeDirectory.__wrap(r0);
1639
1604
  }
1640
1605
  finally {
1641
1606
  wasm$1.__wbindgen_add_to_stack_pointer(16);
@@ -1643,16 +1608,15 @@ class FfiWireE2EIdentity {
1643
1608
  }
1644
1609
  /**
1645
1610
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_account_request]
1646
- * @param {any} directory
1647
1611
  * @param {string} previous_nonce
1648
1612
  * @returns {Uint8Array}
1649
1613
  */
1650
- new_account_request(directory, previous_nonce) {
1614
+ new_account_request(previous_nonce) {
1651
1615
  try {
1652
1616
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1653
1617
  const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1654
1618
  const len0 = WASM_VECTOR_LEN;
1655
- wasm$1.ffiwiree2eidentity_new_account_request(retptr, this.ptr, addHeapObject(directory), ptr0, len0);
1619
+ wasm$1.ffiwiree2eidentity_new_account_request(retptr, this.ptr, ptr0, len0);
1656
1620
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1657
1621
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1658
1622
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1668,7 +1632,7 @@ class FfiWireE2EIdentity {
1668
1632
  /**
1669
1633
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_account_response]
1670
1634
  * @param {Uint8Array} account
1671
- * @returns {Uint8Array}
1635
+ * @returns {any}
1672
1636
  */
1673
1637
  new_account_response(account) {
1674
1638
  try {
@@ -1688,27 +1652,15 @@ class FfiWireE2EIdentity {
1688
1652
  }
1689
1653
  /**
1690
1654
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_order_request]
1691
- * @param {string} display_name
1692
- * @param {string} client_id
1693
- * @param {string} handle
1694
- * @param {number} expiry_days
1695
- * @param {any} directory
1696
- * @param {Uint8Array} account
1697
1655
  * @param {string} previous_nonce
1698
1656
  * @returns {Uint8Array}
1699
1657
  */
1700
- new_order_request(display_name, client_id, handle, expiry_days, directory, account, previous_nonce) {
1658
+ new_order_request(previous_nonce) {
1701
1659
  try {
1702
1660
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1703
- const ptr0 = passStringToWasm0(display_name, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1661
+ const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1704
1662
  const len0 = WASM_VECTOR_LEN;
1705
- const ptr1 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1706
- const len1 = WASM_VECTOR_LEN;
1707
- const ptr2 = passStringToWasm0(handle, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1708
- const len2 = WASM_VECTOR_LEN;
1709
- const ptr3 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1710
- const len3 = WASM_VECTOR_LEN;
1711
- wasm$1.ffiwiree2eidentity_new_order_request(retptr, this.ptr, ptr0, len0, ptr1, len1, ptr2, len2, expiry_days, addHeapObject(directory), addHeapObject(account), ptr3, len3);
1663
+ wasm$1.ffiwiree2eidentity_new_order_request(retptr, this.ptr, ptr0, len0);
1712
1664
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1713
1665
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1714
1666
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1724,7 +1676,7 @@ class FfiWireE2EIdentity {
1724
1676
  /**
1725
1677
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_order_response]
1726
1678
  * @param {Uint8Array} order
1727
- * @returns {any}
1679
+ * @returns {NewAcmeOrder}
1728
1680
  */
1729
1681
  new_order_response(order) {
1730
1682
  try {
@@ -1736,7 +1688,7 @@ class FfiWireE2EIdentity {
1736
1688
  if (r2) {
1737
1689
  throw takeObject(r1);
1738
1690
  }
1739
- return takeObject(r0);
1691
+ return NewAcmeOrder.__wrap(r0);
1740
1692
  }
1741
1693
  finally {
1742
1694
  wasm$1.__wbindgen_add_to_stack_pointer(16);
@@ -1745,18 +1697,17 @@ class FfiWireE2EIdentity {
1745
1697
  /**
1746
1698
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_authz_request]
1747
1699
  * @param {string} url
1748
- * @param {Uint8Array} account
1749
1700
  * @param {string} previous_nonce
1750
1701
  * @returns {Uint8Array}
1751
1702
  */
1752
- new_authz_request(url, account, previous_nonce) {
1703
+ new_authz_request(url, previous_nonce) {
1753
1704
  try {
1754
1705
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1755
1706
  const ptr0 = passStringToWasm0(url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1756
1707
  const len0 = WASM_VECTOR_LEN;
1757
1708
  const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1758
1709
  const len1 = WASM_VECTOR_LEN;
1759
- wasm$1.ffiwiree2eidentity_new_authz_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
1710
+ wasm$1.ffiwiree2eidentity_new_authz_request(retptr, this.ptr, ptr0, len0, ptr1, len1);
1760
1711
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1761
1712
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1762
1713
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1772,7 +1723,7 @@ class FfiWireE2EIdentity {
1772
1723
  /**
1773
1724
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_authz_response]
1774
1725
  * @param {Uint8Array} authz
1775
- * @returns {any}
1726
+ * @returns {NewAcmeAuthz}
1776
1727
  */
1777
1728
  new_authz_response(authz) {
1778
1729
  try {
@@ -1784,7 +1735,7 @@ class FfiWireE2EIdentity {
1784
1735
  if (r2) {
1785
1736
  throw takeObject(r1);
1786
1737
  }
1787
- return takeObject(r0);
1738
+ return NewAcmeAuthz.__wrap(r0);
1788
1739
  }
1789
1740
  finally {
1790
1741
  wasm$1.__wbindgen_add_to_stack_pointer(16);
@@ -1793,56 +1744,43 @@ class FfiWireE2EIdentity {
1793
1744
  /**
1794
1745
  * See [core_crypto::e2e_identity::WireE2eIdentity::create_dpop_token]
1795
1746
  * @param {string} access_token_url
1796
- * @param {string} client_id
1797
- * @param {any} dpop_challenge
1798
1747
  * @param {string} backend_nonce
1799
- * @param {number} expiry_days
1800
- * @returns {string}
1748
+ * @returns {Uint8Array}
1801
1749
  */
1802
- create_dpop_token(access_token_url, client_id, dpop_challenge, backend_nonce, expiry_days) {
1750
+ create_dpop_token(access_token_url, backend_nonce) {
1803
1751
  try {
1804
1752
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1805
1753
  const ptr0 = passStringToWasm0(access_token_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1806
1754
  const len0 = WASM_VECTOR_LEN;
1807
- const ptr1 = passStringToWasm0(client_id, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1755
+ const ptr1 = passStringToWasm0(backend_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1808
1756
  const len1 = WASM_VECTOR_LEN;
1809
- const ptr2 = passStringToWasm0(backend_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1810
- const len2 = WASM_VECTOR_LEN;
1811
- wasm$1.ffiwiree2eidentity_create_dpop_token(retptr, this.ptr, ptr0, len0, ptr1, len1, addHeapObject(dpop_challenge), ptr2, len2, expiry_days);
1757
+ wasm$1.ffiwiree2eidentity_create_dpop_token(retptr, this.ptr, ptr0, len0, ptr1, len1);
1812
1758
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1813
1759
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1814
1760
  var r2 = getInt32Memory0()[retptr / 4 + 2];
1815
- var r3 = getInt32Memory0()[retptr / 4 + 3];
1816
- var ptr3 = r0;
1817
- var len3 = r1;
1818
- if (r3) {
1819
- ptr3 = 0;
1820
- len3 = 0;
1821
- throw takeObject(r2);
1761
+ if (r2) {
1762
+ throw takeObject(r1);
1822
1763
  }
1823
- return getStringFromWasm0(ptr3, len3);
1764
+ return takeObject(r0);
1824
1765
  }
1825
1766
  finally {
1826
1767
  wasm$1.__wbindgen_add_to_stack_pointer(16);
1827
- wasm$1.__wbindgen_free(ptr3, len3);
1828
1768
  }
1829
1769
  }
1830
1770
  /**
1831
1771
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_dpop_challenge_request]
1832
1772
  * @param {string} access_token
1833
- * @param {any} dpop_challenge
1834
- * @param {Uint8Array} account
1835
1773
  * @param {string} previous_nonce
1836
1774
  * @returns {Uint8Array}
1837
1775
  */
1838
- new_dpop_challenge_request(access_token, dpop_challenge, account, previous_nonce) {
1776
+ new_dpop_challenge_request(access_token, previous_nonce) {
1839
1777
  try {
1840
1778
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1841
1779
  const ptr0 = passStringToWasm0(access_token, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1842
1780
  const len0 = WASM_VECTOR_LEN;
1843
1781
  const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1844
1782
  const len1 = WASM_VECTOR_LEN;
1845
- wasm$1.ffiwiree2eidentity_new_dpop_challenge_request(retptr, this.ptr, ptr0, len0, addHeapObject(dpop_challenge), addHeapObject(account), ptr1, len1);
1783
+ wasm$1.ffiwiree2eidentity_new_dpop_challenge_request(retptr, this.ptr, ptr0, len0, ptr1, len1);
1846
1784
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1847
1785
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1848
1786
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1858,19 +1796,17 @@ class FfiWireE2EIdentity {
1858
1796
  /**
1859
1797
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_oidc_challenge_request]
1860
1798
  * @param {string} id_token
1861
- * @param {any} oidc_challenge
1862
- * @param {Uint8Array} account
1863
1799
  * @param {string} previous_nonce
1864
1800
  * @returns {Uint8Array}
1865
1801
  */
1866
- new_oidc_challenge_request(id_token, oidc_challenge, account, previous_nonce) {
1802
+ new_oidc_challenge_request(id_token, previous_nonce) {
1867
1803
  try {
1868
1804
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1869
1805
  const ptr0 = passStringToWasm0(id_token, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1870
1806
  const len0 = WASM_VECTOR_LEN;
1871
1807
  const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1872
1808
  const len1 = WASM_VECTOR_LEN;
1873
- wasm$1.ffiwiree2eidentity_new_oidc_challenge_request(retptr, this.ptr, ptr0, len0, addHeapObject(oidc_challenge), addHeapObject(account), ptr1, len1);
1809
+ wasm$1.ffiwiree2eidentity_new_oidc_challenge_request(retptr, this.ptr, ptr0, len0, ptr1, len1);
1874
1810
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1875
1811
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1876
1812
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1886,6 +1822,7 @@ class FfiWireE2EIdentity {
1886
1822
  /**
1887
1823
  * See [core_crypto::e2e_identity::WireE2eIdentity::new_challenge_response]
1888
1824
  * @param {Uint8Array} challenge
1825
+ * @returns {any}
1889
1826
  */
1890
1827
  new_challenge_response(challenge) {
1891
1828
  try {
@@ -1893,9 +1830,11 @@ class FfiWireE2EIdentity {
1893
1830
  wasm$1.ffiwiree2eidentity_new_challenge_response(retptr, this.ptr, addHeapObject(challenge));
1894
1831
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1895
1832
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1896
- if (r1) {
1897
- throw takeObject(r0);
1833
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
1834
+ if (r2) {
1835
+ throw takeObject(r1);
1898
1836
  }
1837
+ return takeObject(r0);
1899
1838
  }
1900
1839
  finally {
1901
1840
  wasm$1.__wbindgen_add_to_stack_pointer(16);
@@ -1904,18 +1843,17 @@ class FfiWireE2EIdentity {
1904
1843
  /**
1905
1844
  * See [core_crypto::e2e_identity::WireE2eIdentity::check_order_request]
1906
1845
  * @param {string} order_url
1907
- * @param {Uint8Array} account
1908
1846
  * @param {string} previous_nonce
1909
1847
  * @returns {Uint8Array}
1910
1848
  */
1911
- check_order_request(order_url, account, previous_nonce) {
1849
+ check_order_request(order_url, previous_nonce) {
1912
1850
  try {
1913
1851
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1914
1852
  const ptr0 = passStringToWasm0(order_url, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1915
1853
  const len0 = WASM_VECTOR_LEN;
1916
1854
  const ptr1 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1917
1855
  const len1 = WASM_VECTOR_LEN;
1918
- wasm$1.ffiwiree2eidentity_check_order_request(retptr, this.ptr, ptr0, len0, addHeapObject(account), ptr1, len1);
1856
+ wasm$1.ffiwiree2eidentity_check_order_request(retptr, this.ptr, ptr0, len0, ptr1, len1);
1919
1857
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1920
1858
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1921
1859
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1931,7 +1869,7 @@ class FfiWireE2EIdentity {
1931
1869
  /**
1932
1870
  * See [core_crypto::e2e_identity::WireE2eIdentity::check_order_response]
1933
1871
  * @param {Uint8Array} order
1934
- * @returns {Uint8Array}
1872
+ * @returns {any}
1935
1873
  */
1936
1874
  check_order_response(order) {
1937
1875
  try {
@@ -1951,17 +1889,15 @@ class FfiWireE2EIdentity {
1951
1889
  }
1952
1890
  /**
1953
1891
  * See [core_crypto::e2e_identity::WireE2eIdentity::finalize_request]
1954
- * @param {Uint8Array} order
1955
- * @param {Uint8Array} account
1956
1892
  * @param {string} previous_nonce
1957
1893
  * @returns {Uint8Array}
1958
1894
  */
1959
- finalize_request(order, account, previous_nonce) {
1895
+ finalize_request(previous_nonce) {
1960
1896
  try {
1961
1897
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
1962
1898
  const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
1963
1899
  const len0 = WASM_VECTOR_LEN;
1964
- wasm$1.ffiwiree2eidentity_finalize_request(retptr, this.ptr, addHeapObject(order), addHeapObject(account), ptr0, len0);
1900
+ wasm$1.ffiwiree2eidentity_finalize_request(retptr, this.ptr, ptr0, len0);
1965
1901
  var r0 = getInt32Memory0()[retptr / 4 + 0];
1966
1902
  var r1 = getInt32Memory0()[retptr / 4 + 1];
1967
1903
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -1997,17 +1933,15 @@ class FfiWireE2EIdentity {
1997
1933
  }
1998
1934
  /**
1999
1935
  * See [core_crypto::e2e_identity::WireE2eIdentity::certificate_request]
2000
- * @param {any} finalize
2001
- * @param {Uint8Array} account
2002
1936
  * @param {string} previous_nonce
2003
1937
  * @returns {Uint8Array}
2004
1938
  */
2005
- certificate_request(finalize, account, previous_nonce) {
1939
+ certificate_request(previous_nonce) {
2006
1940
  try {
2007
1941
  const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2008
1942
  const ptr0 = passStringToWasm0(previous_nonce, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2009
1943
  const len0 = WASM_VECTOR_LEN;
2010
- wasm$1.ffiwiree2eidentity_certificate_request(retptr, this.ptr, addHeapObject(finalize), addHeapObject(account), ptr0, len0);
1944
+ wasm$1.ffiwiree2eidentity_certificate_request(retptr, this.ptr, ptr0, len0);
2011
1945
  var r0 = getInt32Memory0()[retptr / 4 + 0];
2012
1946
  var r1 = getInt32Memory0()[retptr / 4 + 1];
2013
1947
  var r2 = getInt32Memory0()[retptr / 4 + 2];
@@ -2020,32 +1954,6 @@ class FfiWireE2EIdentity {
2020
1954
  wasm$1.__wbindgen_add_to_stack_pointer(16);
2021
1955
  }
2022
1956
  }
2023
- /**
2024
- * See [core_crypto::e2e_identity::WireE2eIdentity::certificate_response]
2025
- * @param {string} certificate_chain
2026
- * @returns {(Uint8Array)[]}
2027
- */
2028
- certificate_response(certificate_chain) {
2029
- try {
2030
- const retptr = wasm$1.__wbindgen_add_to_stack_pointer(-16);
2031
- const ptr0 = passStringToWasm0(certificate_chain, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
2032
- const len0 = WASM_VECTOR_LEN;
2033
- wasm$1.ffiwiree2eidentity_certificate_response(retptr, this.ptr, ptr0, len0);
2034
- var r0 = getInt32Memory0()[retptr / 4 + 0];
2035
- var r1 = getInt32Memory0()[retptr / 4 + 1];
2036
- var r2 = getInt32Memory0()[retptr / 4 + 2];
2037
- var r3 = getInt32Memory0()[retptr / 4 + 3];
2038
- if (r3) {
2039
- throw takeObject(r2);
2040
- }
2041
- var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
2042
- wasm$1.__wbindgen_free(r0, r1 * 4);
2043
- return v1;
2044
- }
2045
- finally {
2046
- wasm$1.__wbindgen_add_to_stack_pointer(16);
2047
- }
2048
- }
2049
1957
  }
2050
1958
  /**
2051
1959
  * see [core_crypto::prelude::ConversationMember]
@@ -2077,7 +1985,7 @@ class Invitee {
2077
1985
  * @returns {Uint8Array}
2078
1986
  */
2079
1987
  get id() {
2080
- const ret = wasm$1.invitee_id(this.ptr);
1988
+ const ret = wasm$1.acmechallenge_delegate(this.ptr);
2081
1989
  return takeObject(ret);
2082
1990
  }
2083
1991
  /**
@@ -2197,15 +2105,15 @@ class NewAcmeAuthz {
2197
2105
  /**
2198
2106
  * @returns {AcmeChallenge | undefined}
2199
2107
  */
2200
- get wire_dpop_challenge() {
2201
- const ret = wasm$1.newacmeauthz_wire_dpop_challenge(this.ptr);
2108
+ get wireDpopChallenge() {
2109
+ const ret = wasm$1.newacmeauthz_wireDpopChallenge(this.ptr);
2202
2110
  return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
2203
2111
  }
2204
2112
  /**
2205
2113
  * @returns {AcmeChallenge | undefined}
2206
2114
  */
2207
- get wire_oidc_challenge() {
2208
- const ret = wasm$1.newacmeauthz_wire_oidc_challenge(this.ptr);
2115
+ get wireOidcChallenge() {
2116
+ const ret = wasm$1.newacmeauthz_wireOidcChallenge(this.ptr);
2209
2117
  return ret === 0 ? undefined : AcmeChallenge.__wrap(ret);
2210
2118
  }
2211
2119
  }
@@ -2273,7 +2181,7 @@ class ProposalBundle {
2273
2181
  * @returns {Uint8Array}
2274
2182
  */
2275
2183
  get proposal() {
2276
- const ret = wasm$1.invitee_id(this.ptr);
2184
+ const ret = wasm$1.acmechallenge_delegate(this.ptr);
2277
2185
  return takeObject(ret);
2278
2186
  }
2279
2187
  /**
@@ -2375,7 +2283,7 @@ class PublicGroupStateBundle {
2375
2283
  * @returns {Uint8Array}
2376
2284
  */
2377
2285
  get payload() {
2378
- const ret = wasm$1.invitee_id(this.ptr);
2286
+ const ret = wasm$1.acmechallenge_delegate(this.ptr);
2379
2287
  return takeObject(ret);
2380
2288
  }
2381
2289
  }
@@ -2472,10 +2380,6 @@ function getImports() {
2472
2380
  const ret = new Uint8Array(getObject(arg0));
2473
2381
  return addHeapObject(ret);
2474
2382
  };
2475
- imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2476
- const ret = BigInt.asUintN(64, arg0);
2477
- return addHeapObject(ret);
2478
- };
2479
2383
  imports.wbg.__wbg_new_9d3a9ce4282a18a8 = function (arg0, arg1) {
2480
2384
  try {
2481
2385
  var state0 = { a: arg0, b: arg1 };
@@ -2483,7 +2387,7 @@ function getImports() {
2483
2387
  const a = state0.a;
2484
2388
  state0.a = 0;
2485
2389
  try {
2486
- return __wbg_adapter_282(a, state0.b, arg0, arg1);
2390
+ return __wbg_adapter_279(a, state0.b, arg0, arg1);
2487
2391
  }
2488
2392
  finally {
2489
2393
  state0.a = a;
@@ -2496,6 +2400,14 @@ function getImports() {
2496
2400
  state0.a = state0.b = 0;
2497
2401
  }
2498
2402
  };
2403
+ imports.wbg.__wbg_new_f841cc6f2098f4b5 = function () {
2404
+ const ret = new Map();
2405
+ return addHeapObject(ret);
2406
+ };
2407
+ imports.wbg.__wbg_set_388c4c6422704173 = function (arg0, arg1, arg2) {
2408
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2409
+ return addHeapObject(ret);
2410
+ };
2499
2411
  imports.wbg.__wbindgen_number_new = function (arg0) {
2500
2412
  const ret = arg0;
2501
2413
  return addHeapObject(ret);
@@ -2508,26 +2420,22 @@ function getImports() {
2508
2420
  const ret = getObject(arg0).push(getObject(arg1));
2509
2421
  return ret;
2510
2422
  };
2511
- imports.wbg.__wbg_new_f841cc6f2098f4b5 = function () {
2512
- const ret = new Map();
2513
- return addHeapObject(ret);
2514
- };
2515
- imports.wbg.__wbg_set_388c4c6422704173 = function (arg0, arg1, arg2) {
2516
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2423
+ imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
2424
+ const ret = BigInt.asUintN(64, arg0);
2517
2425
  return addHeapObject(ret);
2518
2426
  };
2519
2427
  imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
2520
2428
  const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
2521
2429
  return addHeapObject(ret);
2522
2430
  };
2523
- imports.wbg.__wbg_new_f9876326328f45ed = function () {
2524
- const ret = new Object();
2525
- return addHeapObject(ret);
2526
- };
2527
2431
  imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
2528
2432
  const ret = FfiWireE2EIdentity.__wrap(arg0);
2529
2433
  return addHeapObject(ret);
2530
2434
  };
2435
+ imports.wbg.__wbg_new_f9876326328f45ed = function () {
2436
+ const ret = new Object();
2437
+ return addHeapObject(ret);
2438
+ };
2531
2439
  imports.wbg.__wbg_setonsuccess_925a7718d3f62bc1 = function (arg0, arg1) {
2532
2440
  getObject(arg0).onsuccess = getObject(arg1);
2533
2441
  };
@@ -2539,14 +2447,6 @@ function getImports() {
2539
2447
  const ret = getObject(arg0)[arg1 >>> 0];
2540
2448
  return addHeapObject(ret);
2541
2449
  };
2542
- imports.wbg.__wbg_new0_25059e40b1c02766 = function () {
2543
- const ret = new Date();
2544
- return addHeapObject(ret);
2545
- };
2546
- imports.wbg.__wbg_getTime_7c59072d1651a3cf = function (arg0) {
2547
- const ret = getObject(arg0).getTime();
2548
- return ret;
2549
- };
2550
2450
  imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
2551
2451
  const ret = getObject(arg0) == getObject(arg1);
2552
2452
  return ret;
@@ -3055,6 +2955,14 @@ function getImports() {
3055
2955
  getInt32Memory0()[arg0 / 4 + 1] = len0;
3056
2956
  getInt32Memory0()[arg0 / 4 + 0] = ptr0;
3057
2957
  };
2958
+ imports.wbg.__wbg_new0_25059e40b1c02766 = function () {
2959
+ const ret = new Date();
2960
+ return addHeapObject(ret);
2961
+ };
2962
+ imports.wbg.__wbg_getTime_7c59072d1651a3cf = function (arg0) {
2963
+ const ret = getObject(arg0).getTime();
2964
+ return ret;
2965
+ };
3058
2966
  imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
3059
2967
  const ret = debugString(getObject(arg1));
3060
2968
  const ptr0 = passStringToWasm0(ret, wasm$1.__wbindgen_malloc, wasm$1.__wbindgen_realloc);
@@ -3133,12 +3041,12 @@ function getImports() {
3133
3041
  return addHeapObject(ret);
3134
3042
  }, arguments);
3135
3043
  };
3136
- imports.wbg.__wbindgen_closure_wrapper1553 = function (arg0, arg1, arg2) {
3137
- const ret = makeMutClosure(arg0, arg1, 165, __wbg_adapter_52);
3044
+ imports.wbg.__wbindgen_closure_wrapper1545 = function (arg0, arg1, arg2) {
3045
+ const ret = makeMutClosure(arg0, arg1, 156, __wbg_adapter_52);
3138
3046
  return addHeapObject(ret);
3139
3047
  };
3140
- imports.wbg.__wbindgen_closure_wrapper4705 = function (arg0, arg1, arg2) {
3141
- const ret = makeMutClosure(arg0, arg1, 165, __wbg_adapter_55);
3048
+ imports.wbg.__wbindgen_closure_wrapper4563 = function (arg0, arg1, arg2) {
3049
+ const ret = makeMutClosure(arg0, arg1, 156, __wbg_adapter_55);
3142
3050
  return addHeapObject(ret);
3143
3051
  };
3144
3052
  return imports;
@@ -3174,7 +3082,6 @@ var exports = /*#__PURE__*/Object.freeze({
3174
3082
  __proto__: null,
3175
3083
  AcmeChallenge: AcmeChallenge,
3176
3084
  AcmeDirectory: AcmeDirectory,
3177
- AcmeFinalize: AcmeFinalize,
3178
3085
  Ciphersuite: Ciphersuite$1,
3179
3086
  CommitBundle: CommitBundle,
3180
3087
  ConversationConfiguration: ConversationConfiguration,
@@ -3199,7 +3106,7 @@ var exports = /*#__PURE__*/Object.freeze({
3199
3106
  var wasm = async (opt = {}) => {
3200
3107
  let {importHook, serverPath} = opt;
3201
3108
 
3202
- let path = "assets/core_crypto_ffi-834f6094.wasm";
3109
+ let path = "assets/core_crypto_ffi-2bc82439.wasm";
3203
3110
 
3204
3111
  if (serverPath != null) {
3205
3112
  path = serverPath + /[^\/\\]*$/.exec(path)[0];
@@ -3485,13 +3392,13 @@ class CoreCrypto {
3485
3392
  __classPrivateFieldSet(this, _CoreCrypto_cc, cc, "f");
3486
3393
  }
3487
3394
  /**
3488
- * If this returns > 1 you **cannot** call {@link CoreCrypto.wipe} or {@link CoreCrypto.close} as they will produce an error because of the
3395
+ * If this returns `true` you **cannot** call {@link CoreCrypto.wipe} or {@link CoreCrypto.close} as they will produce an error because of the
3489
3396
  * outstanding references that were detected.
3490
3397
  *
3491
3398
  * @returns the count of strong refs for this CoreCrypto instance
3492
3399
  */
3493
- strongRefCount() {
3494
- return __classPrivateFieldGet(this, _CoreCrypto_cc, "f").strong_ref_count();
3400
+ isLocked() {
3401
+ return __classPrivateFieldGet(this, _CoreCrypto_cc, "f").has_outstanding_refs();
3495
3402
  }
3496
3403
  /**
3497
3404
  * Wipes the {@link CoreCrypto} backing storage (i.e. {@link https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API | IndexedDB} database)
@@ -4169,19 +4076,30 @@ class CoreCrypto {
4169
4076
  /**
4170
4077
  * Creates an enrollment instance with private key material you can use in order to fetch
4171
4078
  * a new x509 certificate from the acme server.
4172
- * Make sure to call {@link WireE2eIdentity.free} to dispose this instance and its associated
4173
- * keying material.
4174
4079
  *
4080
+ * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4081
+ * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
4082
+ * @param handle user handle e.g. `alice.smith.qa@example.com`
4083
+ * @param expiryDays generated x509 certificate expiry
4175
4084
  * @param ciphersuite - For generating signing key material. Only {@link Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519} is supported currently
4176
4085
  * @returns The new {@link WireE2eIdentity} object
4177
4086
  */
4178
- async newAcmeEnrollment(ciphersuite = Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519) {
4087
+ async newAcmeEnrollment(clientId, displayName, handle, expiryDays, ciphersuite = Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519) {
4179
4088
  if (ciphersuite !== Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519) {
4180
4089
  throw new Error("This ACME ciphersuite isn't supported. Only `Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519` is as of now");
4181
4090
  }
4182
- const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_acme_enrollment(ciphersuite));
4091
+ const e2ei = await CoreCryptoError.asyncMapErr(__classPrivateFieldGet(this, _CoreCrypto_cc, "f").new_acme_enrollment(clientId, displayName, handle, expiryDays, ciphersuite));
4183
4092
  return new WireE2eIdentity(e2ei);
4184
4093
  }
4094
+ /**
4095
+ * Parses the ACME server response from the endpoint fetching x509 certificates and uses it to initialize the MLS client with a certificate
4096
+ *
4097
+ * @param e2ei - the enrollment instance used to fetch the certificates
4098
+ * @param certificateChain - the raw response from ACME server
4099
+ */
4100
+ async e2eiMlsInit(e2ei, certificateChain) {
4101
+ return await __classPrivateFieldGet(this, _CoreCrypto_cc, "f").e2ei_mls_init(e2ei.inner(), certificateChain);
4102
+ }
4185
4103
  /**
4186
4104
  * Returns the current version of {@link CoreCrypto}
4187
4105
  *
@@ -4209,6 +4127,12 @@ class WireE2eIdentity {
4209
4127
  free() {
4210
4128
  __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").free();
4211
4129
  }
4130
+ /**
4131
+ * Should only be used internally
4132
+ */
4133
+ inner() {
4134
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f");
4135
+ }
4212
4136
  /**
4213
4137
  * Parses the response from `GET /acme/{provisioner-name}/directory`.
4214
4138
  * Use this {@link AcmeDirectory} in the next step to fetch the first nonce from the acme server. Use
@@ -4229,13 +4153,12 @@ class WireE2eIdentity {
4229
4153
  * For creating a new acme account. This returns a signed JWS-alike request body to send to
4230
4154
  * `POST /acme/{provisioner-name}/new-account`.
4231
4155
  *
4232
- * @param directory you got from {@link directoryResponse}
4233
4156
  * @param previousNonce you got from calling `HEAD {@link AcmeDirectory.newNonce}`
4234
4157
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.3
4235
4158
  */
4236
- newAccountRequest(directory, previousNonce) {
4159
+ newAccountRequest(previousNonce) {
4237
4160
  try {
4238
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_request(directory, previousNonce);
4161
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_account_request(previousNonce);
4239
4162
  }
4240
4163
  catch (e) {
4241
4164
  throw CoreCryptoError.fromStdError(e);
@@ -4257,18 +4180,12 @@ class WireE2eIdentity {
4257
4180
  /**
4258
4181
  * Creates a new acme order for the handle (userId + display name) and the clientId.
4259
4182
  *
4260
- * @param displayName human readable name displayed in the application e.g. `Smith, Alice M (QA)`
4261
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4262
- * @param handle user handle e.g. `alice.smith.qa@example.com`
4263
- * @param expiryDays generated x509 certificate expiry
4264
- * @param directory you got from {@link directoryResponse}
4265
- * @param account you got from {@link newAccountResponse}
4266
4183
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-account`
4267
4184
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
4268
4185
  */
4269
- newOrderRequest(displayName, clientId, handle, expiryDays, directory, account, previousNonce) {
4186
+ newOrderRequest(previousNonce) {
4270
4187
  try {
4271
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_request(displayName, clientId, handle, expiryDays, directory, account, previousNonce);
4188
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_order_request(previousNonce);
4272
4189
  }
4273
4190
  catch (e) {
4274
4191
  throw CoreCryptoError.fromStdError(e);
@@ -4292,14 +4209,13 @@ class WireE2eIdentity {
4292
4209
  * Creates a new authorization request.
4293
4210
  *
4294
4211
  * @param url one of the URL in new order's authorizations (use {@link NewAcmeOrder.authorizations} from {@link newOrderResponse})
4295
- * @param account you got from {@link newAccountResponse}
4296
4212
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/new-order` (or from the
4297
4213
  * previous to this method if you are creating the second authorization)
4298
4214
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
4299
4215
  */
4300
- newAuthzRequest(url, account, previousNonce) {
4216
+ newAuthzRequest(url, previousNonce) {
4301
4217
  try {
4302
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_request(url, account, previousNonce);
4218
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_authz_request(url, previousNonce);
4303
4219
  }
4304
4220
  catch (e) {
4305
4221
  throw CoreCryptoError.fromStdError(e);
@@ -4328,14 +4244,11 @@ class WireE2eIdentity {
4328
4244
  * {@link https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_clients__cid__access_token} on wire-server.
4329
4245
  *
4330
4246
  * @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}
4331
- * @param clientId client identifier with user b64Url encoded & clientId hex encoded e.g. `NDUyMGUyMmY2YjA3NGU3NjkyZjE1NjJjZTAwMmQ2NTQ:6add501bacd1d90e@example.com`
4332
- * @param dpopChallenge you found after {@link newAuthzResponse}
4333
4247
  * @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}
4334
- * @param expiryDays token expiry in days
4335
4248
  */
4336
- createDpopToken(accessTokenUrl, clientId, dpopChallenge, backendNonce, expiryDays) {
4249
+ createDpopToken(accessTokenUrl, backendNonce) {
4337
4250
  try {
4338
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").create_dpop_token(accessTokenUrl, clientId, dpopChallenge, backendNonce, expiryDays);
4251
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").create_dpop_token(accessTokenUrl, backendNonce);
4339
4252
  }
4340
4253
  catch (e) {
4341
4254
  throw CoreCryptoError.fromStdError(e);
@@ -4345,14 +4258,12 @@ class WireE2eIdentity {
4345
4258
  * Creates a new challenge request for Wire Dpop challenge.
4346
4259
  *
4347
4260
  * @param accessToken returned by wire-server from https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_clients__cid__access_token
4348
- * @param dpopChallenge you found after {@link newAuthzResponse}
4349
- * @param account you found after {@link newAccountResponse}
4350
4261
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
4351
4262
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
4352
4263
  */
4353
- newDpopChallengeRequest(accessToken, dpopChallenge, account, previousNonce) {
4264
+ newDpopChallengeRequest(accessToken, previousNonce) {
4354
4265
  try {
4355
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_dpop_challenge_request(accessToken, dpopChallenge, account, previousNonce);
4266
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_dpop_challenge_request(accessToken, previousNonce);
4356
4267
  }
4357
4268
  catch (e) {
4358
4269
  throw CoreCryptoError.fromStdError(e);
@@ -4362,14 +4273,12 @@ class WireE2eIdentity {
4362
4273
  * Creates a new challenge request for Wire Oidc challenge.
4363
4274
  *
4364
4275
  * @param idToken you get back from Identity Provider
4365
- * @param oidcChallenge you found after {@link newAuthzResponse}
4366
- * @param account you found after {@link newAccountResponse}
4367
4276
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/authz/{authz-id}`
4368
4277
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
4369
4278
  */
4370
- newOidcChallengeRequest(idToken, oidcChallenge, account, previousNonce) {
4279
+ newOidcChallengeRequest(idToken, previousNonce) {
4371
4280
  try {
4372
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_oidc_challenge_request(idToken, oidcChallenge, account, previousNonce);
4281
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").new_oidc_challenge_request(idToken, previousNonce);
4373
4282
  }
4374
4283
  catch (e) {
4375
4284
  throw CoreCryptoError.fromStdError(e);
@@ -4397,9 +4306,9 @@ class WireE2eIdentity {
4397
4306
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/challenge/{challenge-id}`
4398
4307
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
4399
4308
  */
4400
- checkOrderRequest(orderUrl, account, previousNonce) {
4309
+ checkOrderRequest(orderUrl, previousNonce) {
4401
4310
  try {
4402
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_request(orderUrl, account, previousNonce);
4311
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").check_order_request(orderUrl, previousNonce);
4403
4312
  }
4404
4313
  catch (e) {
4405
4314
  throw CoreCryptoError.fromStdError(e);
@@ -4423,13 +4332,12 @@ class WireE2eIdentity {
4423
4332
  * Final step before fetching the certificate.
4424
4333
  *
4425
4334
  * @param order - order you got from {@link checkOrderResponse}
4426
- * @param account - account you found after {@link newAccountResponse}
4427
4335
  * @param previousNonce - `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}`
4428
4336
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4
4429
4337
  */
4430
- finalizeRequest(order, account, previousNonce) {
4338
+ finalizeRequest(previousNonce) {
4431
4339
  try {
4432
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_request(order, account, previousNonce);
4340
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").finalize_request(previousNonce);
4433
4341
  }
4434
4342
  catch (e) {
4435
4343
  throw CoreCryptoError.fromStdError(e);
@@ -4452,28 +4360,12 @@ class WireE2eIdentity {
4452
4360
  /**
4453
4361
  * Creates a request for finally fetching the x509 certificate.
4454
4362
  *
4455
- * @param finalize you got from {@link finalizeResponse}
4456
- * @param account you got from {@link newAccountResponse}
4457
4363
  * @param previousNonce `replay-nonce` response header from `POST /acme/{provisioner-name}/order/{order-id}/finalize`
4458
4364
  * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
4459
4365
  */
4460
- certificateRequest(finalize, account, previousNonce) {
4461
- try {
4462
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_request(finalize, account, previousNonce);
4463
- }
4464
- catch (e) {
4465
- throw CoreCryptoError.fromStdError(e);
4466
- }
4467
- }
4468
- /**
4469
- * Parses the response from `POST /acme/{provisioner-name}/certificate/{certificate-id}`.
4470
- *
4471
- * @param certificateChain HTTP string response body
4472
- * @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.4.2
4473
- */
4474
- certificateResponse(certificateChain) {
4366
+ certificateRequest(previousNonce) {
4475
4367
  try {
4476
- return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_response(certificateChain);
4368
+ return __classPrivateFieldGet(this, _WireE2eIdentity_e2ei, "f").certificate_request(previousNonce);
4477
4369
  }
4478
4370
  catch (e) {
4479
4371
  throw CoreCryptoError.fromStdError(e);