@wireapp/core-crypto 1.0.0-rc.11 → 1.0.0-rc.13
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
Binary file
|
@@ -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. `
|
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. `
|
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. `
|
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
|
@@ -39,14 +39,6 @@ const heap = new Array(128).fill(undefined);
|
|
39
39
|
heap.push(undefined, null, true, false);
|
40
40
|
function getObject(idx) { return heap[idx]; }
|
41
41
|
let heap_next = heap.length;
|
42
|
-
function addHeapObject(obj) {
|
43
|
-
if (heap_next === heap.length)
|
44
|
-
heap.push(heap.length + 1);
|
45
|
-
const idx = heap_next;
|
46
|
-
heap_next = heap[idx];
|
47
|
-
heap[idx] = obj;
|
48
|
-
return idx;
|
49
|
-
}
|
50
42
|
function dropObject(idx) {
|
51
43
|
if (idx < 132)
|
52
44
|
return;
|
@@ -58,6 +50,14 @@ function takeObject(idx) {
|
|
58
50
|
dropObject(idx);
|
59
51
|
return ret;
|
60
52
|
}
|
53
|
+
function addHeapObject(obj) {
|
54
|
+
if (heap_next === heap.length)
|
55
|
+
heap.push(heap.length + 1);
|
56
|
+
const idx = heap_next;
|
57
|
+
heap_next = heap[idx];
|
58
|
+
heap[idx] = obj;
|
59
|
+
return idx;
|
60
|
+
}
|
61
61
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available'); } });
|
62
62
|
if (typeof TextDecoder !== 'undefined') {
|
63
63
|
cachedTextDecoder.decode();
|
@@ -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.
|
237
|
+
wasm$1.wasm_bindgen__convert__closures__invoke1_mut__he49f61f93f482307(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.
|
242
|
+
wasm$1.wasm_bindgen__convert__closures__invoke1_mut__h699880155985670b(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
|
254
|
-
|
255
|
-
|
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
|
267
|
-
|
264
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
265
|
+
ptr = ptr >>> 0;
|
268
266
|
const mem = getUint32Memory0();
|
269
|
-
|
270
|
-
|
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
|
-
|
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
|
317
|
-
wasm$1.
|
316
|
+
function __wbg_adapter_308(arg0, arg1, arg2, arg3) {
|
317
|
+
wasm$1.wasm_bindgen__convert__closures__invoke2_mut__hce9b3acf9dc10eb7(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
|
-
*
|
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
|
-
*
|
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
|
-
|
418
|
-
|
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.
|
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.
|
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
|
-
*
|
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
|
-
*
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
-
*
|
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
|
-
*
|
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.
|
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.
|
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.
|
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
|
-
*
|
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
|
-
* @
|
2584
|
-
* @param {(Uint8Array)[]} authorizations
|
2560
|
+
* @returns {(Uint8Array)[]}
|
2585
2561
|
*/
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
2590
|
-
|
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
|
-
|
2597
|
-
|
2598
|
-
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2603
|
-
|
2604
|
-
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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,6 +2939,9 @@ async function __wbg_load(module, imports) {
|
|
2951
2939
|
function __wbg_get_imports() {
|
2952
2940
|
const imports = {};
|
2953
2941
|
imports.wbg = {};
|
2942
|
+
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
2943
|
+
takeObject(arg0);
|
2944
|
+
};
|
2954
2945
|
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
|
2955
2946
|
const ret = getObject(arg0);
|
2956
2947
|
return addHeapObject(ret);
|
@@ -2960,10 +2951,7 @@ function __wbg_get_imports() {
|
|
2960
2951
|
const ret = typeof (val) === 'object' && val !== null;
|
2961
2952
|
return ret;
|
2962
2953
|
};
|
2963
|
-
imports.wbg.
|
2964
|
-
takeObject(arg0);
|
2965
|
-
};
|
2966
|
-
imports.wbg.__wbg_getwithrefkey_5e6d9547403deab8 = function (arg0, arg1) {
|
2954
|
+
imports.wbg.__wbg_getwithrefkey_d1f0d12f1f1b63ea = function (arg0, arg1) {
|
2967
2955
|
const ret = getObject(arg0)[getObject(arg1)];
|
2968
2956
|
return addHeapObject(ret);
|
2969
2957
|
};
|
@@ -3025,33 +3013,32 @@ function __wbg_get_imports() {
|
|
3025
3013
|
const ret = new Uint8Array(getObject(arg0));
|
3026
3014
|
return addHeapObject(ret);
|
3027
3015
|
};
|
3016
|
+
imports.wbg.__wbindgen_number_new = function (arg0) {
|
3017
|
+
const ret = arg0;
|
3018
|
+
return addHeapObject(ret);
|
3019
|
+
};
|
3028
3020
|
imports.wbg.__wbg_ffiwiree2eidentity_new = function (arg0) {
|
3029
3021
|
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
3030
3022
|
return addHeapObject(ret);
|
3031
3023
|
};
|
3032
|
-
imports.wbg.
|
3033
|
-
const ret =
|
3024
|
+
imports.wbg.__wbg_new_b51585de1b234aff = function () {
|
3025
|
+
const ret = new Object();
|
3034
3026
|
return addHeapObject(ret);
|
3035
3027
|
};
|
3036
|
-
imports.wbg.
|
3037
|
-
|
3038
|
-
return addHeapObject(ret);
|
3028
|
+
imports.wbg.__wbg_set_bd72c078edfa51ad = function (arg0, arg1, arg2) {
|
3029
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
3039
3030
|
};
|
3040
3031
|
imports.wbg.__wbg_new_898a68150f225f2e = function () {
|
3041
3032
|
const ret = new Array();
|
3042
3033
|
return addHeapObject(ret);
|
3043
3034
|
};
|
3035
|
+
imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
|
3036
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
3037
|
+
};
|
3044
3038
|
imports.wbg.__wbg_push_ca1c26067ef907ac = function (arg0, arg1) {
|
3045
3039
|
const ret = getObject(arg0).push(getObject(arg1));
|
3046
3040
|
return ret;
|
3047
3041
|
};
|
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
3042
|
imports.wbg.__wbg_new_56693dbed0c32988 = function () {
|
3056
3043
|
const ret = new Map();
|
3057
3044
|
return addHeapObject(ret);
|
@@ -3060,13 +3047,14 @@ function __wbg_get_imports() {
|
|
3060
3047
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
3061
3048
|
return addHeapObject(ret);
|
3062
3049
|
};
|
3063
|
-
imports.wbg.__wbg_set_502d29070ea18557 = function (arg0, arg1, arg2) {
|
3064
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
3065
|
-
};
|
3066
3050
|
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
3067
3051
|
const ret = BigInt.asUintN(64, arg0);
|
3068
3052
|
return addHeapObject(ret);
|
3069
3053
|
};
|
3054
|
+
imports.wbg.__wbg_proteusautoprekeybundle_new = function (arg0) {
|
3055
|
+
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
3056
|
+
return addHeapObject(ret);
|
3057
|
+
};
|
3070
3058
|
imports.wbg.__wbg_new_d258248ed531ff54 = function (arg0, arg1) {
|
3071
3059
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
3072
3060
|
return addHeapObject(ret);
|
@@ -3190,7 +3178,7 @@ function __wbg_get_imports() {
|
|
3190
3178
|
const a = state0.a;
|
3191
3179
|
state0.a = 0;
|
3192
3180
|
try {
|
3193
|
-
return
|
3181
|
+
return __wbg_adapter_308(a, state0.b, arg0, arg1);
|
3194
3182
|
}
|
3195
3183
|
finally {
|
3196
3184
|
state0.a = a;
|
@@ -3469,6 +3457,12 @@ function __wbg_get_imports() {
|
|
3469
3457
|
const ret = getObject(arg0).target;
|
3470
3458
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
3471
3459
|
};
|
3460
|
+
imports.wbg.__wbg_error_8a79f35fe9368563 = function () {
|
3461
|
+
return handleError(function (arg0) {
|
3462
|
+
const ret = getObject(arg0).error;
|
3463
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
3464
|
+
}, arguments);
|
3465
|
+
};
|
3472
3466
|
imports.wbg.__wbg_result_edff16ff107d6acb = function () {
|
3473
3467
|
return handleError(function (arg0) {
|
3474
3468
|
const ret = getObject(arg0).result;
|
@@ -3509,12 +3503,6 @@ function __wbg_get_imports() {
|
|
3509
3503
|
getObject(arg0).deleteObjectStore(getStringFromWasm0(arg1, arg2));
|
3510
3504
|
}, arguments);
|
3511
3505
|
};
|
3512
|
-
imports.wbg.__wbg_error_8a79f35fe9368563 = function () {
|
3513
|
-
return handleError(function (arg0) {
|
3514
|
-
const ret = getObject(arg0).error;
|
3515
|
-
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
3516
|
-
}, arguments);
|
3517
|
-
};
|
3518
3506
|
imports.wbg.__wbindgen_is_falsy = function (arg0) {
|
3519
3507
|
const ret = !getObject(arg0);
|
3520
3508
|
return 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.
|
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,11 +3631,11 @@ function __wbg_get_imports() {
|
|
3643
3631
|
return addHeapObject(ret);
|
3644
3632
|
}, arguments);
|
3645
3633
|
};
|
3646
|
-
imports.wbg.
|
3634
|
+
imports.wbg.__wbindgen_closure_wrapper1746 = function (arg0, arg1, arg2) {
|
3647
3635
|
const ret = makeMutClosure(arg0, arg1, 149, __wbg_adapter_52);
|
3648
3636
|
return addHeapObject(ret);
|
3649
3637
|
};
|
3650
|
-
imports.wbg.
|
3638
|
+
imports.wbg.__wbindgen_closure_wrapper4866 = function (arg0, arg1, arg2) {
|
3651
3639
|
const ret = makeMutClosure(arg0, arg1, 149, __wbg_adapter_55);
|
3652
3640
|
return addHeapObject(ret);
|
3653
3641
|
};
|
@@ -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-
|
3706
|
+
const wasm_path = "assets/core_crypto_ffi-3baa8d34.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. `
|
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. `
|
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. `
|
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
|
Binary file
|