@wireapp/core-crypto 1.0.0-rc.38 → 1.0.0-rc.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* see [core_crypto::prelude::DeviceStatus]
|
|
3
|
-
*/
|
|
4
|
-
export enum DeviceStatus {
|
|
5
|
-
/**
|
|
6
|
-
* All is fine
|
|
7
|
-
*/
|
|
8
|
-
Valid = 0,
|
|
9
|
-
/**
|
|
10
|
-
* The Credential's certificate is expired
|
|
11
|
-
*/
|
|
12
|
-
Expired = 1,
|
|
13
|
-
/**
|
|
14
|
-
* The Credential's certificate is revoked (not implemented yet)
|
|
15
|
-
*/
|
|
16
|
-
Revoked = 2
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
2
|
* For creating a challenge.
|
|
20
3
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
|
|
21
4
|
*/
|
|
@@ -36,29 +19,6 @@ export class AcmeChallenge {
|
|
|
36
19
|
readonly url: string;
|
|
37
20
|
}
|
|
38
21
|
/**
|
|
39
|
-
* Holds URLs of all the standard ACME endpoint supported on an ACME server.
|
|
40
|
-
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
|
|
41
|
-
*/
|
|
42
|
-
export class AcmeDirectory {
|
|
43
|
-
free(): void;
|
|
44
|
-
/**
|
|
45
|
-
* URL for creating a new account.
|
|
46
|
-
*/
|
|
47
|
-
readonly newAccount: string;
|
|
48
|
-
/**
|
|
49
|
-
* URL for fetching a new nonce. Use this only for creating a new account.
|
|
50
|
-
*/
|
|
51
|
-
readonly newNonce: string;
|
|
52
|
-
/**
|
|
53
|
-
* URL for creating a new order.
|
|
54
|
-
*/
|
|
55
|
-
readonly newOrder: string;
|
|
56
|
-
/**
|
|
57
|
-
* Revocation URL
|
|
58
|
-
*/
|
|
59
|
-
readonly revokeCert: string;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
22
|
* Result of an authorization creation.
|
|
63
23
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
|
|
64
24
|
*/
|
|
@@ -91,41 +51,6 @@ export class NewAcmeOrder {
|
|
|
91
51
|
*/
|
|
92
52
|
readonly delegate: Uint8Array;
|
|
93
53
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Represents the identity claims identifying a client
|
|
96
|
-
* Those claims are verifiable by any member in the group
|
|
97
|
-
*/
|
|
98
|
-
export class WireIdentity {
|
|
99
|
-
free(): void;
|
|
100
|
-
/**
|
|
101
|
-
* X509 certificate identifying this client in the MLS group ; PEM encoded
|
|
102
|
-
*/
|
|
103
|
-
readonly certificate: string;
|
|
104
|
-
/**
|
|
105
|
-
* Unique client identifier e.g. `T4Coy4vdRzianwfOgXpn6A:6add501bacd1d90e@whitehouse.gov`
|
|
106
|
-
*/
|
|
107
|
-
readonly clientId: string;
|
|
108
|
-
/**
|
|
109
|
-
* Name as displayed in the messaging application e.g. `John Fitzgerald Kennedy`
|
|
110
|
-
*/
|
|
111
|
-
readonly displayName: string;
|
|
112
|
-
/**
|
|
113
|
-
* DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
|
|
114
|
-
*/
|
|
115
|
-
readonly domain: string;
|
|
116
|
-
/**
|
|
117
|
-
* user handle e.g. `john_wire`
|
|
118
|
-
*/
|
|
119
|
-
readonly handle: string;
|
|
120
|
-
/**
|
|
121
|
-
* Status of the Credential at the moment T when this object is created
|
|
122
|
-
*/
|
|
123
|
-
readonly status: DeviceStatus;
|
|
124
|
-
/**
|
|
125
|
-
* MLS thumbprint
|
|
126
|
-
*/
|
|
127
|
-
readonly thumbprint: string;
|
|
128
|
-
}
|
|
129
54
|
/**
|
|
130
55
|
* Error wrapper that takes care of extracting rich error details across the FFI (through JSON parsing)
|
|
131
56
|
*
|
|
@@ -564,6 +489,88 @@ export interface BufferedDecryptedMessage {
|
|
|
564
489
|
*/
|
|
565
490
|
crlNewDistributionPoints?: string[];
|
|
566
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
* Represents the identity claims identifying a client
|
|
494
|
+
* Those claims are verifiable by any member in the group
|
|
495
|
+
*/
|
|
496
|
+
export interface WireIdentity {
|
|
497
|
+
/**
|
|
498
|
+
* Unique client identifier
|
|
499
|
+
*/
|
|
500
|
+
clientId: string;
|
|
501
|
+
/**
|
|
502
|
+
* User handle e.g. `john_wire`
|
|
503
|
+
*/
|
|
504
|
+
handle: string;
|
|
505
|
+
/**
|
|
506
|
+
* Name as displayed in the messaging application e.g. `John Fitzgerald Kennedy`
|
|
507
|
+
*/
|
|
508
|
+
displayName: string;
|
|
509
|
+
/**
|
|
510
|
+
* DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
|
|
511
|
+
*/
|
|
512
|
+
domain: string;
|
|
513
|
+
/**
|
|
514
|
+
* X509 certificate identifying this client in the MLS group ; PEM encoded
|
|
515
|
+
*/
|
|
516
|
+
certificate: string;
|
|
517
|
+
/**
|
|
518
|
+
* Status of the Credential at the moment T when this object is created
|
|
519
|
+
*/
|
|
520
|
+
status: DeviceStatus;
|
|
521
|
+
/**
|
|
522
|
+
* MLS thumbprint
|
|
523
|
+
*/
|
|
524
|
+
thumbprint: string;
|
|
525
|
+
/**
|
|
526
|
+
* X509 certificate serial number
|
|
527
|
+
*/
|
|
528
|
+
serialNumber: string;
|
|
529
|
+
/**
|
|
530
|
+
* X509 certificate not before as Unix timestamp
|
|
531
|
+
*/
|
|
532
|
+
notBefore: bigint;
|
|
533
|
+
/**
|
|
534
|
+
* X509 certificate not after as Unix timestamp
|
|
535
|
+
*/
|
|
536
|
+
notAfter: bigint;
|
|
537
|
+
}
|
|
538
|
+
export interface AcmeDirectory {
|
|
539
|
+
/**
|
|
540
|
+
* URL for fetching a new nonce. Use this only for creating a new account.
|
|
541
|
+
*/
|
|
542
|
+
newNonce: string;
|
|
543
|
+
/**
|
|
544
|
+
* URL for creating a new account.
|
|
545
|
+
*/
|
|
546
|
+
newAccount: string;
|
|
547
|
+
/**
|
|
548
|
+
* URL for creating a new order.
|
|
549
|
+
*/
|
|
550
|
+
newOrder: string;
|
|
551
|
+
/**
|
|
552
|
+
* Revocation URL
|
|
553
|
+
*/
|
|
554
|
+
revokeCert: string;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Indicates the standalone status of a device Credential in a MLS group at a moment T.
|
|
558
|
+
* This does not represent the states where a device is not using MLS or is not using end-to-end identity
|
|
559
|
+
*/
|
|
560
|
+
export declare enum DeviceStatus {
|
|
561
|
+
/**
|
|
562
|
+
* All is fine
|
|
563
|
+
*/
|
|
564
|
+
Valid = 0,
|
|
565
|
+
/**
|
|
566
|
+
* The Credential's certificate is expired
|
|
567
|
+
*/
|
|
568
|
+
Expired = 1,
|
|
569
|
+
/**
|
|
570
|
+
* The Credential's certificate is revoked
|
|
571
|
+
*/
|
|
572
|
+
Revoked = 2
|
|
573
|
+
}
|
|
567
574
|
/**
|
|
568
575
|
* Returned by all methods creating proposals. Contains a proposal message and an identifier to roll back the proposal
|
|
569
576
|
*/
|
|
@@ -160,12 +160,12 @@ var makeMutClosure = function(arg0, arg1, dtor, f) {
|
|
|
160
160
|
return real;
|
|
161
161
|
};
|
|
162
162
|
var __wbg_adapter_54 = function(arg0, arg1, arg2) {
|
|
163
|
-
wasm.
|
|
163
|
+
wasm.wasm_bindgen__convert__closures__invoke1_mut__h601e8bd711f8c2cf(arg0, arg1, addHeapObject(arg2));
|
|
164
164
|
};
|
|
165
165
|
var __wbg_adapter_57 = function(arg0, arg1, arg2) {
|
|
166
166
|
try {
|
|
167
167
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
168
|
-
wasm.
|
|
168
|
+
wasm.wasm_bindgen__convert__closures__invoke1_mut__h853f0d8ce45de15b(retptr, arg0, arg1, addHeapObject(arg2));
|
|
169
169
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
170
170
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
171
171
|
if (r1) {
|
|
@@ -235,8 +235,8 @@ var handleError = function(f, args) {
|
|
|
235
235
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
|
-
var
|
|
239
|
-
wasm.
|
|
238
|
+
var __wbg_adapter_421 = function(arg0, arg1, arg2, arg3) {
|
|
239
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h6bedc2125abb8b9f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
240
240
|
};
|
|
241
241
|
async function __wbg_load(module, imports) {
|
|
242
242
|
if (typeof Response === "function" && module instanceof Response) {
|
|
@@ -265,49 +265,49 @@ async function __wbg_load(module, imports) {
|
|
|
265
265
|
var __wbg_get_imports = function() {
|
|
266
266
|
const imports = {};
|
|
267
267
|
imports.wbg = {};
|
|
268
|
-
imports.wbg.
|
|
269
|
-
const ret = arg0;
|
|
270
|
-
return addHeapObject(ret);
|
|
271
|
-
};
|
|
272
|
-
imports.wbg.__wbg_newacmeorder_new = function(arg0) {
|
|
273
|
-
const ret = NewAcmeOrder.__wrap(arg0);
|
|
268
|
+
imports.wbg.__wbg_acmedirectory_new = function(arg0) {
|
|
269
|
+
const ret = AcmeDirectory.__wrap(arg0);
|
|
274
270
|
return addHeapObject(ret);
|
|
275
271
|
};
|
|
276
|
-
imports.wbg.
|
|
277
|
-
const ret =
|
|
272
|
+
imports.wbg.__wbg_ffiwiree2eidentity_new = function(arg0) {
|
|
273
|
+
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
|
278
274
|
return addHeapObject(ret);
|
|
279
275
|
};
|
|
280
|
-
imports.wbg.
|
|
281
|
-
const ret =
|
|
276
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
277
|
+
const ret = arg0;
|
|
282
278
|
return addHeapObject(ret);
|
|
283
279
|
};
|
|
284
280
|
imports.wbg.__wbg_newacmeauthz_new = function(arg0) {
|
|
285
281
|
const ret = NewAcmeAuthz.__wrap(arg0);
|
|
286
282
|
return addHeapObject(ret);
|
|
287
283
|
};
|
|
288
|
-
imports.wbg.
|
|
289
|
-
const ret =
|
|
284
|
+
imports.wbg.__wbg_commitbundle_new = function(arg0) {
|
|
285
|
+
const ret = CommitBundle.__wrap(arg0);
|
|
290
286
|
return addHeapObject(ret);
|
|
291
287
|
};
|
|
292
|
-
imports.wbg.
|
|
293
|
-
|
|
288
|
+
imports.wbg.__wbg_proposalbundle_new = function(arg0) {
|
|
289
|
+
const ret = ProposalBundle.__wrap(arg0);
|
|
290
|
+
return addHeapObject(ret);
|
|
294
291
|
};
|
|
295
|
-
imports.wbg.
|
|
296
|
-
const ret =
|
|
292
|
+
imports.wbg.__wbg_buffereddecryptedmessage_new = function(arg0) {
|
|
293
|
+
const ret = BufferedDecryptedMessage.__wrap(arg0);
|
|
297
294
|
return addHeapObject(ret);
|
|
298
295
|
};
|
|
299
|
-
imports.wbg.
|
|
300
|
-
const ret =
|
|
296
|
+
imports.wbg.__wbg_newacmeorder_new = function(arg0) {
|
|
297
|
+
const ret = NewAcmeOrder.__wrap(arg0);
|
|
301
298
|
return addHeapObject(ret);
|
|
302
299
|
};
|
|
303
|
-
imports.wbg.
|
|
304
|
-
const ret =
|
|
300
|
+
imports.wbg.__wbg_corecrypto_new = function(arg0) {
|
|
301
|
+
const ret = CoreCrypto.__wrap(arg0);
|
|
305
302
|
return addHeapObject(ret);
|
|
306
303
|
};
|
|
307
|
-
imports.wbg.
|
|
308
|
-
const ret =
|
|
304
|
+
imports.wbg.__wbg_proteusautoprekeybundle_new = function(arg0) {
|
|
305
|
+
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
|
309
306
|
return addHeapObject(ret);
|
|
310
307
|
};
|
|
308
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
309
|
+
takeObject(arg0);
|
|
310
|
+
};
|
|
311
311
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
312
312
|
const ret = getObject(arg0);
|
|
313
313
|
return addHeapObject(ret);
|
|
@@ -889,7 +889,7 @@ var __wbg_get_imports = function() {
|
|
|
889
889
|
const a = state0.a;
|
|
890
890
|
state0.a = 0;
|
|
891
891
|
try {
|
|
892
|
-
return
|
|
892
|
+
return __wbg_adapter_421(a, state0.b, arg02, arg12);
|
|
893
893
|
} finally {
|
|
894
894
|
state0.a = a;
|
|
895
895
|
}
|
|
@@ -969,12 +969,12 @@ var __wbg_get_imports = function() {
|
|
|
969
969
|
const ret = wasm.memory;
|
|
970
970
|
return addHeapObject(ret);
|
|
971
971
|
};
|
|
972
|
-
imports.wbg.
|
|
972
|
+
imports.wbg.__wbindgen_closure_wrapper2578 = function(arg0, arg1, arg2) {
|
|
973
973
|
const ret = makeMutClosure(arg0, arg1, 652, __wbg_adapter_54);
|
|
974
974
|
return addHeapObject(ret);
|
|
975
975
|
};
|
|
976
|
-
imports.wbg.
|
|
977
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
976
|
+
imports.wbg.__wbindgen_closure_wrapper13188 = function(arg0, arg1, arg2) {
|
|
977
|
+
const ret = makeMutClosure(arg0, arg1, 2185, __wbg_adapter_57);
|
|
978
978
|
return addHeapObject(ret);
|
|
979
979
|
};
|
|
980
980
|
return imports;
|
|
@@ -1169,12 +1169,12 @@ class AcmeDirectory {
|
|
|
1169
1169
|
const ptr = this.__destroy_into_raw();
|
|
1170
1170
|
wasm.__wbg_acmedirectory_free(ptr);
|
|
1171
1171
|
}
|
|
1172
|
-
get
|
|
1172
|
+
get new_nonce() {
|
|
1173
1173
|
let deferred1_0;
|
|
1174
1174
|
let deferred1_1;
|
|
1175
1175
|
try {
|
|
1176
1176
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1177
|
-
wasm.
|
|
1177
|
+
wasm.__wbg_get_acmedirectory_new_nonce(retptr, this.__wbg_ptr);
|
|
1178
1178
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1179
1179
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1180
1180
|
deferred1_0 = r0;
|
|
@@ -1185,7 +1185,7 @@ class AcmeDirectory {
|
|
|
1185
1185
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
|
-
get
|
|
1188
|
+
get new_account() {
|
|
1189
1189
|
let deferred1_0;
|
|
1190
1190
|
let deferred1_1;
|
|
1191
1191
|
try {
|
|
@@ -1201,7 +1201,7 @@ class AcmeDirectory {
|
|
|
1201
1201
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
|
-
get
|
|
1204
|
+
get new_order() {
|
|
1205
1205
|
let deferred1_0;
|
|
1206
1206
|
let deferred1_1;
|
|
1207
1207
|
try {
|
|
@@ -1217,12 +1217,12 @@ class AcmeDirectory {
|
|
|
1217
1217
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
|
-
get
|
|
1220
|
+
get revoke_cert() {
|
|
1221
1221
|
let deferred1_0;
|
|
1222
1222
|
let deferred1_1;
|
|
1223
1223
|
try {
|
|
1224
1224
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1225
|
-
wasm.
|
|
1225
|
+
wasm.__wbg_get_acmedirectory_revoke_cert(retptr, this.__wbg_ptr);
|
|
1226
1226
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1227
1227
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1228
1228
|
deferred1_0 = r0;
|
|
@@ -2163,7 +2163,7 @@ class NewAcmeAuthz {
|
|
|
2163
2163
|
let deferred1_1;
|
|
2164
2164
|
try {
|
|
2165
2165
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2166
|
-
wasm.
|
|
2166
|
+
wasm.__wbg_get_acmedirectory_new_nonce(retptr, this.__wbg_ptr);
|
|
2167
2167
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2168
2168
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2169
2169
|
deferred1_0 = r0;
|
|
@@ -2355,12 +2355,12 @@ class WireIdentity {
|
|
|
2355
2355
|
const ptr = this.__destroy_into_raw();
|
|
2356
2356
|
wasm.__wbg_wireidentity_free(ptr);
|
|
2357
2357
|
}
|
|
2358
|
-
get
|
|
2358
|
+
get client_id() {
|
|
2359
2359
|
let deferred1_0;
|
|
2360
2360
|
let deferred1_1;
|
|
2361
2361
|
try {
|
|
2362
2362
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2363
|
-
wasm.
|
|
2363
|
+
wasm.__wbg_get_wireidentity_client_id(retptr, this.__wbg_ptr);
|
|
2364
2364
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2365
2365
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2366
2366
|
deferred1_0 = r0;
|
|
@@ -2376,7 +2376,7 @@ class WireIdentity {
|
|
|
2376
2376
|
let deferred1_1;
|
|
2377
2377
|
try {
|
|
2378
2378
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2379
|
-
wasm.
|
|
2379
|
+
wasm.__wbg_get_wireidentity_handle(retptr, this.__wbg_ptr);
|
|
2380
2380
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2381
2381
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2382
2382
|
deferred1_0 = r0;
|
|
@@ -2387,12 +2387,12 @@ class WireIdentity {
|
|
|
2387
2387
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2388
2388
|
}
|
|
2389
2389
|
}
|
|
2390
|
-
get
|
|
2390
|
+
get display_name() {
|
|
2391
2391
|
let deferred1_0;
|
|
2392
2392
|
let deferred1_1;
|
|
2393
2393
|
try {
|
|
2394
2394
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2395
|
-
wasm.
|
|
2395
|
+
wasm.__wbg_get_wireidentity_display_name(retptr, this.__wbg_ptr);
|
|
2396
2396
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2397
2397
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2398
2398
|
deferred1_0 = r0;
|
|
@@ -2408,7 +2408,7 @@ class WireIdentity {
|
|
|
2408
2408
|
let deferred1_1;
|
|
2409
2409
|
try {
|
|
2410
2410
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2411
|
-
wasm.
|
|
2411
|
+
wasm.__wbg_get_wireidentity_domain(retptr, this.__wbg_ptr);
|
|
2412
2412
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2413
2413
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2414
2414
|
deferred1_0 = r0;
|
|
@@ -2455,6 +2455,30 @@ class WireIdentity {
|
|
|
2455
2455
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2456
2456
|
}
|
|
2457
2457
|
}
|
|
2458
|
+
get serial_number() {
|
|
2459
|
+
let deferred1_0;
|
|
2460
|
+
let deferred1_1;
|
|
2461
|
+
try {
|
|
2462
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2463
|
+
wasm.__wbg_get_wireidentity_serial_number(retptr, this.__wbg_ptr);
|
|
2464
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2465
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2466
|
+
deferred1_0 = r0;
|
|
2467
|
+
deferred1_1 = r1;
|
|
2468
|
+
return getStringFromWasm0(r0, r1);
|
|
2469
|
+
} finally {
|
|
2470
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2471
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
2472
|
+
}
|
|
2473
|
+
}
|
|
2474
|
+
get not_before() {
|
|
2475
|
+
const ret = wasm.__wbg_get_wireidentity_not_before(this.__wbg_ptr);
|
|
2476
|
+
return BigInt.asUintN(64, ret);
|
|
2477
|
+
}
|
|
2478
|
+
get not_after() {
|
|
2479
|
+
const ret = wasm.__wbg_get_wireidentity_not_after(this.__wbg_ptr);
|
|
2480
|
+
return BigInt.asUintN(64, ret);
|
|
2481
|
+
}
|
|
2458
2482
|
}
|
|
2459
2483
|
var core_crypto_ffi_default = __wbg_init;
|
|
2460
2484
|
|
|
@@ -2537,6 +2561,29 @@ var RatchetTreeType;
|
|
|
2537
2561
|
RatchetTreeType2[RatchetTreeType2["Delta"] = 2] = "Delta";
|
|
2538
2562
|
RatchetTreeType2[RatchetTreeType2["ByRef"] = 3] = "ByRef";
|
|
2539
2563
|
})(RatchetTreeType || (RatchetTreeType = {}));
|
|
2564
|
+
var mapWireIdentity = (ffiIdentity) => {
|
|
2565
|
+
if (!ffiIdentity) {
|
|
2566
|
+
return;
|
|
2567
|
+
}
|
|
2568
|
+
return {
|
|
2569
|
+
clientId: ffiIdentity.client_id,
|
|
2570
|
+
handle: ffiIdentity.handle,
|
|
2571
|
+
displayName: ffiIdentity.display_name,
|
|
2572
|
+
domain: ffiIdentity.domain,
|
|
2573
|
+
certificate: ffiIdentity.certificate,
|
|
2574
|
+
status: ffiIdentity.status,
|
|
2575
|
+
thumbprint: ffiIdentity.thumbprint,
|
|
2576
|
+
serialNumber: ffiIdentity.serial_number,
|
|
2577
|
+
notBefore: ffiIdentity.not_before,
|
|
2578
|
+
notAfter: ffiIdentity.not_after
|
|
2579
|
+
};
|
|
2580
|
+
};
|
|
2581
|
+
var DeviceStatus2;
|
|
2582
|
+
(function(DeviceStatus3) {
|
|
2583
|
+
DeviceStatus3[DeviceStatus3["Valid"] = 0] = "Valid";
|
|
2584
|
+
DeviceStatus3[DeviceStatus3["Expired"] = 1] = "Expired";
|
|
2585
|
+
DeviceStatus3[DeviceStatus3["Revoked"] = 2] = "Revoked";
|
|
2586
|
+
})(DeviceStatus2 || (DeviceStatus2 = {}));
|
|
2540
2587
|
var ProposalType;
|
|
2541
2588
|
(function(ProposalType2) {
|
|
2542
2589
|
ProposalType2[ProposalType2["Add"] = 0] = "Add";
|
|
@@ -2660,24 +2707,25 @@ class CoreCrypto2 {
|
|
|
2660
2707
|
if (typeof ffiCommitDelay === "number" && ffiCommitDelay >= 0) {
|
|
2661
2708
|
commitDelay = ffiCommitDelay * 1000;
|
|
2662
2709
|
}
|
|
2710
|
+
const identity = mapWireIdentity(ffiDecryptedMessage.identity);
|
|
2663
2711
|
const ret = {
|
|
2664
2712
|
message: ffiDecryptedMessage.message,
|
|
2665
2713
|
proposals: ffiDecryptedMessage.proposals,
|
|
2666
2714
|
isActive: ffiDecryptedMessage.is_active,
|
|
2667
2715
|
senderClientId: ffiDecryptedMessage.sender_client_id,
|
|
2668
2716
|
commitDelay,
|
|
2717
|
+
identity,
|
|
2669
2718
|
hasEpochChanged: ffiDecryptedMessage.has_epoch_changed,
|
|
2670
|
-
bufferedMessages: ffiDecryptedMessage.buffered_messages?.map((m) => {
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
}),
|
|
2719
|
+
bufferedMessages: ffiDecryptedMessage.buffered_messages?.map((m) => ({
|
|
2720
|
+
message: m.message,
|
|
2721
|
+
proposals: m.proposals,
|
|
2722
|
+
isActive: m.is_active,
|
|
2723
|
+
senderClientId: m.sender_client_id,
|
|
2724
|
+
commitDelay: m.commit_delay,
|
|
2725
|
+
identity: mapWireIdentity(m.identity),
|
|
2726
|
+
hasEpochChanged: m.has_epoch_changed,
|
|
2727
|
+
crlNewDistributionPoints: m.crl_new_distribution_points
|
|
2728
|
+
})),
|
|
2681
2729
|
crlNewDistributionPoints: ffiDecryptedMessage.crl_new_distribution_points
|
|
2682
2730
|
};
|
|
2683
2731
|
return ret;
|
|
@@ -2985,10 +3033,10 @@ class CoreCrypto2 {
|
|
|
2985
3033
|
return await CoreCryptoError.asyncMapErr(this.#cc.e2ei_is_enabled(ciphersuite));
|
|
2986
3034
|
}
|
|
2987
3035
|
async getDeviceIdentities(conversationId, deviceIds) {
|
|
2988
|
-
return await CoreCryptoError.asyncMapErr(this.#cc.get_device_identities(conversationId, deviceIds));
|
|
3036
|
+
return (await CoreCryptoError.asyncMapErr(this.#cc.get_device_identities(conversationId, deviceIds))).map(mapWireIdentity);
|
|
2989
3037
|
}
|
|
2990
3038
|
async getUserIdentities(conversationId, userIds) {
|
|
2991
|
-
return await CoreCryptoError.asyncMapErr(this.#cc.get_user_identities(conversationId, userIds));
|
|
3039
|
+
return (await CoreCryptoError.asyncMapErr(this.#cc.get_user_identities(conversationId, userIds))).map(([userId, identities]) => [userId, identities.map(mapWireIdentity)]);
|
|
2992
3040
|
}
|
|
2993
3041
|
async getCredentialInUse(groupInfo, credentialType = CredentialType2.X509) {
|
|
2994
3042
|
let state = await CoreCryptoError.asyncMapErr(this.#cc.get_credential_in_use(groupInfo, credentialType));
|
|
@@ -3012,7 +3060,13 @@ class E2eiEnrollment {
|
|
|
3012
3060
|
return this.#enrollment;
|
|
3013
3061
|
}
|
|
3014
3062
|
async directoryResponse(directory) {
|
|
3015
|
-
|
|
3063
|
+
const ffiRet = await CoreCryptoError.asyncMapErr(this.#enrollment.directory_response(directory));
|
|
3064
|
+
return {
|
|
3065
|
+
newNonce: ffiRet.new_nonce,
|
|
3066
|
+
newAccount: ffiRet.new_account,
|
|
3067
|
+
newOrder: ffiRet.new_order,
|
|
3068
|
+
revokeCert: ffiRet.revoke_cert
|
|
3069
|
+
};
|
|
3016
3070
|
}
|
|
3017
3071
|
async newAccountRequest(previousNonce) {
|
|
3018
3072
|
return await CoreCryptoError.asyncMapErr(this.#enrollment.new_account_request(previousNonce));
|
|
@@ -3071,7 +3125,6 @@ var E2eiConversationState;
|
|
|
3071
3125
|
})(E2eiConversationState || (E2eiConversationState = {}));
|
|
3072
3126
|
export {
|
|
3073
3127
|
WirePolicy2 as WirePolicy,
|
|
3074
|
-
WireIdentity,
|
|
3075
3128
|
RatchetTreeType,
|
|
3076
3129
|
ProposalType,
|
|
3077
3130
|
NewAcmeOrder,
|
|
@@ -3080,11 +3133,10 @@ export {
|
|
|
3080
3133
|
ExternalProposalType,
|
|
3081
3134
|
E2eiEnrollment,
|
|
3082
3135
|
E2eiConversationState,
|
|
3083
|
-
DeviceStatus,
|
|
3136
|
+
DeviceStatus2 as DeviceStatus,
|
|
3084
3137
|
CredentialType2 as CredentialType,
|
|
3085
3138
|
CoreCryptoError,
|
|
3086
3139
|
CoreCrypto2 as CoreCrypto,
|
|
3087
3140
|
Ciphersuite2 as Ciphersuite,
|
|
3088
|
-
AcmeDirectory,
|
|
3089
3141
|
AcmeChallenge
|
|
3090
3142
|
};
|