@wireapp/core-crypto 1.0.0-rc.37 → 1.0.0-rc.39
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
Binary file
|
@@ -1,22 +1,3 @@
|
|
1
|
-
/* tslint:disable */
|
2
|
-
/* eslint-disable */
|
3
|
-
/**
|
4
|
-
* see [core_crypto::prelude::DeviceStatus]
|
5
|
-
*/
|
6
|
-
export enum DeviceStatus {
|
7
|
-
/**
|
8
|
-
* All is fine
|
9
|
-
*/
|
10
|
-
Valid = 0,
|
11
|
-
/**
|
12
|
-
* The Credential's certificate is expired
|
13
|
-
*/
|
14
|
-
Expired = 1,
|
15
|
-
/**
|
16
|
-
* The Credential's certificate is revoked (not implemented yet)
|
17
|
-
*/
|
18
|
-
Revoked = 2
|
19
|
-
}
|
20
1
|
/**
|
21
2
|
* For creating a challenge.
|
22
3
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5.1
|
@@ -38,29 +19,6 @@ export class AcmeChallenge {
|
|
38
19
|
readonly url: string;
|
39
20
|
}
|
40
21
|
/**
|
41
|
-
* Holds URLs of all the standard ACME endpoint supported on an ACME server.
|
42
|
-
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.1.1
|
43
|
-
*/
|
44
|
-
export class AcmeDirectory {
|
45
|
-
free(): void;
|
46
|
-
/**
|
47
|
-
* URL for creating a new account.
|
48
|
-
*/
|
49
|
-
readonly newAccount: string;
|
50
|
-
/**
|
51
|
-
* URL for fetching a new nonce. Use this only for creating a new account.
|
52
|
-
*/
|
53
|
-
readonly newNonce: string;
|
54
|
-
/**
|
55
|
-
* URL for creating a new order.
|
56
|
-
*/
|
57
|
-
readonly newOrder: string;
|
58
|
-
/**
|
59
|
-
* Revocation URL
|
60
|
-
*/
|
61
|
-
readonly revokeCert: string;
|
62
|
-
}
|
63
|
-
/**
|
64
22
|
* Result of an authorization creation.
|
65
23
|
* @see https://www.rfc-editor.org/rfc/rfc8555.html#section-7.5
|
66
24
|
*/
|
@@ -93,41 +51,6 @@ export class NewAcmeOrder {
|
|
93
51
|
*/
|
94
52
|
readonly delegate: Uint8Array;
|
95
53
|
}
|
96
|
-
/**
|
97
|
-
* Represents the identity claims identifying a client
|
98
|
-
* Those claims are verifiable by any member in the group
|
99
|
-
*/
|
100
|
-
export class WireIdentity {
|
101
|
-
free(): void;
|
102
|
-
/**
|
103
|
-
* X509 certificate identifying this client in the MLS group ; PEM encoded
|
104
|
-
*/
|
105
|
-
readonly certificate: string;
|
106
|
-
/**
|
107
|
-
* Unique client identifier e.g. `T4Coy4vdRzianwfOgXpn6A:6add501bacd1d90e@whitehouse.gov`
|
108
|
-
*/
|
109
|
-
readonly clientId: string;
|
110
|
-
/**
|
111
|
-
* Name as displayed in the messaging application e.g. `John Fitzgerald Kennedy`
|
112
|
-
*/
|
113
|
-
readonly displayName: string;
|
114
|
-
/**
|
115
|
-
* DNS domain for which this identity proof was generated e.g. `whitehouse.gov`
|
116
|
-
*/
|
117
|
-
readonly domain: string;
|
118
|
-
/**
|
119
|
-
* user handle e.g. `john_wire`
|
120
|
-
*/
|
121
|
-
readonly handle: string;
|
122
|
-
/**
|
123
|
-
* Status of the Credential at the moment T when this object is created
|
124
|
-
*/
|
125
|
-
readonly status: DeviceStatus;
|
126
|
-
/**
|
127
|
-
* MLS thumbprint
|
128
|
-
*/
|
129
|
-
readonly thumbprint: string;
|
130
|
-
}
|
131
54
|
/**
|
132
55
|
* Error wrapper that takes care of extracting rich error details across the FFI (through JSON parsing)
|
133
56
|
*
|
@@ -566,6 +489,88 @@ export interface BufferedDecryptedMessage {
|
|
566
489
|
*/
|
567
490
|
crlNewDistributionPoints?: string[];
|
568
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
|
+
}
|
569
574
|
/**
|
570
575
|
* Returned by all methods creating proposals. Contains a proposal message and an identifier to roll back the proposal
|
571
576
|
*/
|
@@ -1075,6 +1080,15 @@ export declare class CoreCrypto {
|
|
1075
1080
|
* @returns A `Uint8Array` representing the derived key
|
1076
1081
|
*/
|
1077
1082
|
exportSecretKey(conversationId: ConversationId, keyLength: number): Promise<Uint8Array>;
|
1083
|
+
/**
|
1084
|
+
* Returns the raw public key of the single external sender present in this group.
|
1085
|
+
* This should be used to initialize a subconversation
|
1086
|
+
*
|
1087
|
+
* @param conversationId - The group's ID
|
1088
|
+
*
|
1089
|
+
* @returns A `Uint8Array` representing the external sender raw public key
|
1090
|
+
*/
|
1091
|
+
getExternalSender(conversationId: ConversationId): Promise<Uint8Array>;
|
1078
1092
|
/**
|
1079
1093
|
* Returns all clients from group's members
|
1080
1094
|
*
|
@@ -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,57 +265,53 @@ 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 =
|
268
|
+
imports.wbg.__wbg_acmedirectory_new = function(arg0) {
|
269
|
+
const ret = AcmeDirectory.__wrap(arg0);
|
270
|
+
return addHeapObject(ret);
|
271
|
+
};
|
272
|
+
imports.wbg.__wbg_ffiwiree2eidentity_new = function(arg0) {
|
273
|
+
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
270
274
|
return addHeapObject(ret);
|
271
275
|
};
|
272
276
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
273
277
|
const ret = arg0;
|
274
278
|
return addHeapObject(ret);
|
275
279
|
};
|
276
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
277
|
-
takeObject(arg0);
|
278
|
-
};
|
279
280
|
imports.wbg.__wbg_newacmeauthz_new = function(arg0) {
|
280
281
|
const ret = NewAcmeAuthz.__wrap(arg0);
|
281
282
|
return addHeapObject(ret);
|
282
283
|
};
|
283
|
-
imports.wbg.__wbg_proposalbundle_new = function(arg0) {
|
284
|
-
const ret = ProposalBundle.__wrap(arg0);
|
285
|
-
return addHeapObject(ret);
|
286
|
-
};
|
287
284
|
imports.wbg.__wbg_commitbundle_new = function(arg0) {
|
288
285
|
const ret = CommitBundle.__wrap(arg0);
|
289
286
|
return addHeapObject(ret);
|
290
287
|
};
|
291
|
-
imports.wbg.
|
292
|
-
const ret =
|
288
|
+
imports.wbg.__wbg_proposalbundle_new = function(arg0) {
|
289
|
+
const ret = ProposalBundle.__wrap(arg0);
|
293
290
|
return addHeapObject(ret);
|
294
291
|
};
|
295
292
|
imports.wbg.__wbg_buffereddecryptedmessage_new = function(arg0) {
|
296
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);
|
298
|
+
return addHeapObject(ret);
|
299
|
+
};
|
300
|
+
imports.wbg.__wbg_corecrypto_new = function(arg0) {
|
301
|
+
const ret = CoreCrypto.__wrap(arg0);
|
301
302
|
return addHeapObject(ret);
|
302
303
|
};
|
303
304
|
imports.wbg.__wbg_proteusautoprekeybundle_new = function(arg0) {
|
304
305
|
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
305
306
|
return addHeapObject(ret);
|
306
307
|
};
|
307
|
-
imports.wbg.
|
308
|
-
|
309
|
-
return addHeapObject(ret);
|
308
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
309
|
+
takeObject(arg0);
|
310
310
|
};
|
311
311
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
312
312
|
const ret = getObject(arg0);
|
313
313
|
return addHeapObject(ret);
|
314
314
|
};
|
315
|
-
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
316
|
-
const ret = BigInt.asUintN(64, arg0);
|
317
|
-
return addHeapObject(ret);
|
318
|
-
};
|
319
315
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
320
316
|
const ret = getStringFromWasm0(arg0, arg1);
|
321
317
|
return addHeapObject(ret);
|
@@ -328,6 +324,10 @@ var __wbg_get_imports = function() {
|
|
328
324
|
const ret = getObject(arg0) === null;
|
329
325
|
return ret;
|
330
326
|
};
|
327
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
328
|
+
const ret = BigInt.asUintN(64, arg0);
|
329
|
+
return addHeapObject(ret);
|
330
|
+
};
|
331
331
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
332
332
|
const obj = getObject(arg1);
|
333
333
|
const ret = typeof obj === "string" ? obj : undefined;
|
@@ -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.
|
973
|
-
const ret = makeMutClosure(arg0, arg1,
|
972
|
+
imports.wbg.__wbindgen_closure_wrapper2578 = function(arg0, arg1, arg2) {
|
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;
|
@@ -1041,19 +1041,11 @@ var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: ()
|
|
1041
1041
|
});
|
1042
1042
|
var cachedUint32Memory0 = null;
|
1043
1043
|
var cachedUint16Memory0 = null;
|
1044
|
-
var
|
1045
|
-
|
1046
|
-
"
|
1047
|
-
|
1048
|
-
"
|
1049
|
-
Revoked: 2,
|
1050
|
-
"2": "Revoked"
|
1051
|
-
});
|
1052
|
-
var WirePolicy = Object.freeze({
|
1053
|
-
Plaintext: 1,
|
1054
|
-
"1": "Plaintext",
|
1055
|
-
Ciphertext: 2,
|
1056
|
-
"2": "Ciphertext"
|
1044
|
+
var CredentialType = Object.freeze({
|
1045
|
+
Basic: 1,
|
1046
|
+
"1": "Basic",
|
1047
|
+
X509: 2,
|
1048
|
+
"2": "X509"
|
1057
1049
|
});
|
1058
1050
|
var Ciphersuite = Object.freeze({
|
1059
1051
|
MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519: 1,
|
@@ -1073,11 +1065,19 @@ var Ciphersuite = Object.freeze({
|
|
1073
1065
|
MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519: 61489,
|
1074
1066
|
"61489": "MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519"
|
1075
1067
|
});
|
1076
|
-
var
|
1077
|
-
|
1078
|
-
"
|
1079
|
-
|
1080
|
-
"
|
1068
|
+
var DeviceStatus = Object.freeze({
|
1069
|
+
Valid: 0,
|
1070
|
+
"0": "Valid",
|
1071
|
+
Expired: 1,
|
1072
|
+
"1": "Expired",
|
1073
|
+
Revoked: 2,
|
1074
|
+
"2": "Revoked"
|
1075
|
+
});
|
1076
|
+
var WirePolicy = Object.freeze({
|
1077
|
+
Plaintext: 1,
|
1078
|
+
"1": "Plaintext",
|
1079
|
+
Ciphertext: 2,
|
1080
|
+
"2": "Ciphertext"
|
1081
1081
|
});
|
1082
1082
|
var AcmeChallengeFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
1083
1083
|
}, unregister: () => {
|
@@ -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;
|
@@ -1918,6 +1918,12 @@ class CoreCrypto {
|
|
1918
1918
|
const ret = wasm.corecrypto_export_secret_key(this.__wbg_ptr, ptr0, len0, key_length);
|
1919
1919
|
return takeObject(ret);
|
1920
1920
|
}
|
1921
|
+
get_external_sender(id) {
|
1922
|
+
const ptr0 = passArray8ToWasm0(id, wasm.__wbindgen_malloc);
|
1923
|
+
const len0 = WASM_VECTOR_LEN;
|
1924
|
+
const ret = wasm.corecrypto_get_external_sender(this.__wbg_ptr, ptr0, len0);
|
1925
|
+
return takeObject(ret);
|
1926
|
+
}
|
1921
1927
|
get_client_ids(conversation_id) {
|
1922
1928
|
const ptr0 = passArray8ToWasm0(conversation_id, wasm.__wbindgen_malloc);
|
1923
1929
|
const len0 = WASM_VECTOR_LEN;
|
@@ -2157,7 +2163,7 @@ class NewAcmeAuthz {
|
|
2157
2163
|
let deferred1_1;
|
2158
2164
|
try {
|
2159
2165
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2160
|
-
wasm.
|
2166
|
+
wasm.__wbg_get_acmedirectory_new_nonce(retptr, this.__wbg_ptr);
|
2161
2167
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2162
2168
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2163
2169
|
deferred1_0 = r0;
|
@@ -2349,12 +2355,12 @@ class WireIdentity {
|
|
2349
2355
|
const ptr = this.__destroy_into_raw();
|
2350
2356
|
wasm.__wbg_wireidentity_free(ptr);
|
2351
2357
|
}
|
2352
|
-
get
|
2358
|
+
get client_id() {
|
2353
2359
|
let deferred1_0;
|
2354
2360
|
let deferred1_1;
|
2355
2361
|
try {
|
2356
2362
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2357
|
-
wasm.
|
2363
|
+
wasm.__wbg_get_wireidentity_client_id(retptr, this.__wbg_ptr);
|
2358
2364
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2359
2365
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2360
2366
|
deferred1_0 = r0;
|
@@ -2370,7 +2376,7 @@ class WireIdentity {
|
|
2370
2376
|
let deferred1_1;
|
2371
2377
|
try {
|
2372
2378
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2373
|
-
wasm.
|
2379
|
+
wasm.__wbg_get_wireidentity_handle(retptr, this.__wbg_ptr);
|
2374
2380
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2375
2381
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2376
2382
|
deferred1_0 = r0;
|
@@ -2381,12 +2387,12 @@ class WireIdentity {
|
|
2381
2387
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2382
2388
|
}
|
2383
2389
|
}
|
2384
|
-
get
|
2390
|
+
get display_name() {
|
2385
2391
|
let deferred1_0;
|
2386
2392
|
let deferred1_1;
|
2387
2393
|
try {
|
2388
2394
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2389
|
-
wasm.
|
2395
|
+
wasm.__wbg_get_wireidentity_display_name(retptr, this.__wbg_ptr);
|
2390
2396
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2391
2397
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2392
2398
|
deferred1_0 = r0;
|
@@ -2402,7 +2408,7 @@ class WireIdentity {
|
|
2402
2408
|
let deferred1_1;
|
2403
2409
|
try {
|
2404
2410
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2405
|
-
wasm.
|
2411
|
+
wasm.__wbg_get_wireidentity_domain(retptr, this.__wbg_ptr);
|
2406
2412
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2407
2413
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2408
2414
|
deferred1_0 = r0;
|
@@ -2449,6 +2455,30 @@ class WireIdentity {
|
|
2449
2455
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2450
2456
|
}
|
2451
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
|
+
}
|
2452
2482
|
}
|
2453
2483
|
var core_crypto_ffi_default = __wbg_init;
|
2454
2484
|
|
@@ -2531,6 +2561,29 @@ var RatchetTreeType;
|
|
2531
2561
|
RatchetTreeType2[RatchetTreeType2["Delta"] = 2] = "Delta";
|
2532
2562
|
RatchetTreeType2[RatchetTreeType2["ByRef"] = 3] = "ByRef";
|
2533
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 = {}));
|
2534
2587
|
var ProposalType;
|
2535
2588
|
(function(ProposalType2) {
|
2536
2589
|
ProposalType2[ProposalType2["Add"] = 0] = "Add";
|
@@ -2654,24 +2707,25 @@ class CoreCrypto2 {
|
|
2654
2707
|
if (typeof ffiCommitDelay === "number" && ffiCommitDelay >= 0) {
|
2655
2708
|
commitDelay = ffiCommitDelay * 1000;
|
2656
2709
|
}
|
2710
|
+
const identity = mapWireIdentity(ffiDecryptedMessage.identity);
|
2657
2711
|
const ret = {
|
2658
2712
|
message: ffiDecryptedMessage.message,
|
2659
2713
|
proposals: ffiDecryptedMessage.proposals,
|
2660
2714
|
isActive: ffiDecryptedMessage.is_active,
|
2661
2715
|
senderClientId: ffiDecryptedMessage.sender_client_id,
|
2662
2716
|
commitDelay,
|
2717
|
+
identity,
|
2663
2718
|
hasEpochChanged: ffiDecryptedMessage.has_epoch_changed,
|
2664
|
-
bufferedMessages: ffiDecryptedMessage.buffered_messages?.map((m) => {
|
2665
|
-
|
2666
|
-
|
2667
|
-
|
2668
|
-
|
2669
|
-
|
2670
|
-
|
2671
|
-
|
2672
|
-
|
2673
|
-
|
2674
|
-
}),
|
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
|
+
})),
|
2675
2729
|
crlNewDistributionPoints: ffiDecryptedMessage.crl_new_distribution_points
|
2676
2730
|
};
|
2677
2731
|
return ret;
|
@@ -2853,6 +2907,9 @@ class CoreCrypto2 {
|
|
2853
2907
|
async exportSecretKey(conversationId, keyLength) {
|
2854
2908
|
return await CoreCryptoError.asyncMapErr(this.#cc.export_secret_key(conversationId, keyLength));
|
2855
2909
|
}
|
2910
|
+
async getExternalSender(conversationId) {
|
2911
|
+
return await CoreCryptoError.asyncMapErr(this.#cc.get_external_sender(conversationId));
|
2912
|
+
}
|
2856
2913
|
async getClientIds(conversationId) {
|
2857
2914
|
return await CoreCryptoError.asyncMapErr(this.#cc.get_client_ids(conversationId));
|
2858
2915
|
}
|
@@ -2976,10 +3033,10 @@ class CoreCrypto2 {
|
|
2976
3033
|
return await CoreCryptoError.asyncMapErr(this.#cc.e2ei_is_enabled(ciphersuite));
|
2977
3034
|
}
|
2978
3035
|
async getDeviceIdentities(conversationId, deviceIds) {
|
2979
|
-
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);
|
2980
3037
|
}
|
2981
3038
|
async getUserIdentities(conversationId, userIds) {
|
2982
|
-
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)]);
|
2983
3040
|
}
|
2984
3041
|
async getCredentialInUse(groupInfo, credentialType = CredentialType2.X509) {
|
2985
3042
|
let state = await CoreCryptoError.asyncMapErr(this.#cc.get_credential_in_use(groupInfo, credentialType));
|
@@ -3003,7 +3060,13 @@ class E2eiEnrollment {
|
|
3003
3060
|
return this.#enrollment;
|
3004
3061
|
}
|
3005
3062
|
async directoryResponse(directory) {
|
3006
|
-
|
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
|
+
};
|
3007
3070
|
}
|
3008
3071
|
async newAccountRequest(previousNonce) {
|
3009
3072
|
return await CoreCryptoError.asyncMapErr(this.#enrollment.new_account_request(previousNonce));
|
@@ -3062,7 +3125,6 @@ var E2eiConversationState;
|
|
3062
3125
|
})(E2eiConversationState || (E2eiConversationState = {}));
|
3063
3126
|
export {
|
3064
3127
|
WirePolicy2 as WirePolicy,
|
3065
|
-
WireIdentity,
|
3066
3128
|
RatchetTreeType,
|
3067
3129
|
ProposalType,
|
3068
3130
|
NewAcmeOrder,
|
@@ -3071,11 +3133,10 @@ export {
|
|
3071
3133
|
ExternalProposalType,
|
3072
3134
|
E2eiEnrollment,
|
3073
3135
|
E2eiConversationState,
|
3074
|
-
DeviceStatus,
|
3136
|
+
DeviceStatus2 as DeviceStatus,
|
3075
3137
|
CredentialType2 as CredentialType,
|
3076
3138
|
CoreCryptoError,
|
3077
3139
|
CoreCrypto2 as CoreCrypto,
|
3078
3140
|
Ciphersuite2 as Ciphersuite,
|
3079
|
-
AcmeDirectory,
|
3080
3141
|
AcmeChallenge
|
3081
3142
|
};
|