@wireapp/core-crypto 1.0.0-rc.53 → 1.0.0-rc.55
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
Binary file
|
@@ -516,6 +516,27 @@ export interface WireIdentity {
|
|
516
516
|
* Unique client identifier
|
517
517
|
*/
|
518
518
|
clientId: string;
|
519
|
+
/**
|
520
|
+
* Status of the Credential at the moment T when this object is created
|
521
|
+
*/
|
522
|
+
status: DeviceStatus;
|
523
|
+
/**
|
524
|
+
* MLS thumbprint
|
525
|
+
*/
|
526
|
+
thumbprint: string;
|
527
|
+
/**
|
528
|
+
* Indicates whether the credential is Basic or X509
|
529
|
+
*/
|
530
|
+
credentialType: CredentialType;
|
531
|
+
/**
|
532
|
+
* In case {@link credentialType} is {@link CredentialType.X509} this is populated
|
533
|
+
*/
|
534
|
+
x509Identity?: X509Identity;
|
535
|
+
}
|
536
|
+
/**
|
537
|
+
* Represents the parts of {@link WireIdentity} that are specific to a X509 certificate (and not a Basic one).
|
538
|
+
*/
|
539
|
+
export interface X509Identity {
|
519
540
|
/**
|
520
541
|
* User handle e.g. `john_wire`
|
521
542
|
*/
|
@@ -532,14 +553,6 @@ export interface WireIdentity {
|
|
532
553
|
* X509 certificate identifying this client in the MLS group ; PEM encoded
|
533
554
|
*/
|
534
555
|
certificate: string;
|
535
|
-
/**
|
536
|
-
* Status of the Credential at the moment T when this object is created
|
537
|
-
*/
|
538
|
-
status: DeviceStatus;
|
539
|
-
/**
|
540
|
-
* MLS thumbprint
|
541
|
-
*/
|
542
|
-
thumbprint: string;
|
543
556
|
/**
|
544
557
|
* X509 certificate serial number
|
545
558
|
*/
|
@@ -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__hfa3277b2fbfe66b9(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__h521280b192b0a8ba(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_430 = function(arg0, arg1, arg2, arg3) {
|
239
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3879710de5014195(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.__wbg_ffiwiree2eidentity_new = function(arg0) {
|
269
|
-
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
270
|
-
return addHeapObject(ret);
|
271
|
-
};
|
272
268
|
imports.wbg.__wbg_proposalbundle_new = function(arg0) {
|
273
269
|
const ret = ProposalBundle.__wrap(arg0);
|
274
270
|
return addHeapObject(ret);
|
275
271
|
};
|
276
|
-
imports.wbg.__wbg_proteusautoprekeybundle_new = function(arg0) {
|
277
|
-
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
278
|
-
return addHeapObject(ret);
|
279
|
-
};
|
280
272
|
imports.wbg.__wbindgen_number_new = function(arg0) {
|
281
273
|
const ret = arg0;
|
282
274
|
return addHeapObject(ret);
|
283
275
|
};
|
284
|
-
imports.wbg.
|
285
|
-
const ret =
|
276
|
+
imports.wbg.__wbg_acmedirectory_new = function(arg0) {
|
277
|
+
const ret = AcmeDirectory.__wrap(arg0);
|
286
278
|
return addHeapObject(ret);
|
287
279
|
};
|
288
|
-
imports.wbg.
|
289
|
-
|
280
|
+
imports.wbg.__wbg_proteusautoprekeybundle_new = function(arg0) {
|
281
|
+
const ret = ProteusAutoPrekeyBundle.__wrap(arg0);
|
282
|
+
return addHeapObject(ret);
|
290
283
|
};
|
291
|
-
imports.wbg.
|
292
|
-
const ret =
|
284
|
+
imports.wbg.__wbg_ffiwiree2eidentity_new = function(arg0) {
|
285
|
+
const ret = FfiWireE2EIdentity.__wrap(arg0);
|
293
286
|
return addHeapObject(ret);
|
294
287
|
};
|
295
|
-
imports.wbg.
|
296
|
-
const ret =
|
288
|
+
imports.wbg.__wbg_newacmeauthz_new = function(arg0) {
|
289
|
+
const ret = NewAcmeAuthz.__wrap(arg0);
|
297
290
|
return addHeapObject(ret);
|
298
291
|
};
|
299
|
-
imports.wbg.
|
300
|
-
const ret =
|
292
|
+
imports.wbg.__wbg_commitbundle_new = function(arg0) {
|
293
|
+
const ret = CommitBundle.__wrap(arg0);
|
301
294
|
return addHeapObject(ret);
|
302
295
|
};
|
303
296
|
imports.wbg.__wbg_corecrypto_new = function(arg0) {
|
304
297
|
const ret = CoreCrypto.__wrap(arg0);
|
305
298
|
return addHeapObject(ret);
|
306
299
|
};
|
300
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
301
|
+
takeObject(arg0);
|
302
|
+
};
|
307
303
|
imports.wbg.__wbg_buffereddecryptedmessage_new = function(arg0) {
|
308
304
|
const ret = BufferedDecryptedMessage.__wrap(arg0);
|
309
305
|
return addHeapObject(ret);
|
310
306
|
};
|
307
|
+
imports.wbg.__wbg_newacmeorder_new = function(arg0) {
|
308
|
+
const ret = NewAcmeOrder.__wrap(arg0);
|
309
|
+
return addHeapObject(ret);
|
310
|
+
};
|
311
311
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
312
312
|
const ret = getObject(arg0);
|
313
313
|
return addHeapObject(ret);
|
@@ -899,7 +899,7 @@ var __wbg_get_imports = function() {
|
|
899
899
|
const a = state0.a;
|
900
900
|
state0.a = 0;
|
901
901
|
try {
|
902
|
-
return
|
902
|
+
return __wbg_adapter_430(a, state0.b, arg02, arg12);
|
903
903
|
} finally {
|
904
904
|
state0.a = a;
|
905
905
|
}
|
@@ -979,12 +979,12 @@ var __wbg_get_imports = function() {
|
|
979
979
|
const ret = wasm.memory;
|
980
980
|
return addHeapObject(ret);
|
981
981
|
};
|
982
|
-
imports.wbg.
|
982
|
+
imports.wbg.__wbindgen_closure_wrapper2677 = function(arg0, arg1, arg2) {
|
983
983
|
const ret = makeMutClosure(arg0, arg1, 667, __wbg_adapter_54);
|
984
984
|
return addHeapObject(ret);
|
985
985
|
};
|
986
|
-
imports.wbg.
|
987
|
-
const ret = makeMutClosure(arg0, arg1,
|
986
|
+
imports.wbg.__wbindgen_closure_wrapper13411 = function(arg0, arg1, arg2) {
|
987
|
+
const ret = makeMutClosure(arg0, arg1, 2185, __wbg_adapter_57);
|
988
988
|
return addHeapObject(ret);
|
989
989
|
};
|
990
990
|
return imports;
|
@@ -1051,6 +1051,26 @@ var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: ()
|
|
1051
1051
|
});
|
1052
1052
|
var cachedUint32Memory0 = null;
|
1053
1053
|
var cachedUint16Memory0 = null;
|
1054
|
+
var DeviceStatus = Object.freeze({
|
1055
|
+
Valid: 1,
|
1056
|
+
"1": "Valid",
|
1057
|
+
Expired: 2,
|
1058
|
+
"2": "Expired",
|
1059
|
+
Revoked: 3,
|
1060
|
+
"3": "Revoked"
|
1061
|
+
});
|
1062
|
+
var WirePolicy = Object.freeze({
|
1063
|
+
Plaintext: 1,
|
1064
|
+
"1": "Plaintext",
|
1065
|
+
Ciphertext: 2,
|
1066
|
+
"2": "Ciphertext"
|
1067
|
+
});
|
1068
|
+
var CredentialType = Object.freeze({
|
1069
|
+
Basic: 1,
|
1070
|
+
"1": "Basic",
|
1071
|
+
X509: 2,
|
1072
|
+
"2": "X509"
|
1073
|
+
});
|
1054
1074
|
var Ciphersuite = Object.freeze({
|
1055
1075
|
MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519: 1,
|
1056
1076
|
"1": "MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519",
|
@@ -1069,26 +1089,6 @@ var Ciphersuite = Object.freeze({
|
|
1069
1089
|
MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519: 61489,
|
1070
1090
|
"61489": "MLS_128_X25519KYBER768DRAFT00_AES128GCM_SHA256_Ed25519"
|
1071
1091
|
});
|
1072
|
-
var WirePolicy = Object.freeze({
|
1073
|
-
Plaintext: 1,
|
1074
|
-
"1": "Plaintext",
|
1075
|
-
Ciphertext: 2,
|
1076
|
-
"2": "Ciphertext"
|
1077
|
-
});
|
1078
|
-
var DeviceStatus = Object.freeze({
|
1079
|
-
Valid: 1,
|
1080
|
-
"1": "Valid",
|
1081
|
-
Expired: 2,
|
1082
|
-
"2": "Expired",
|
1083
|
-
Revoked: 3,
|
1084
|
-
"3": "Revoked"
|
1085
|
-
});
|
1086
|
-
var CredentialType = Object.freeze({
|
1087
|
-
Basic: 1,
|
1088
|
-
"1": "Basic",
|
1089
|
-
X509: 2,
|
1090
|
-
"2": "X509"
|
1091
|
-
});
|
1092
1092
|
var AcmeChallengeFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
1093
1093
|
}, unregister: () => {
|
1094
1094
|
} } : new FinalizationRegistry((ptr) => wasm.__wbg_acmechallenge_free(ptr >>> 0));
|
@@ -1299,7 +1299,7 @@ class BufferedDecryptedMessage {
|
|
1299
1299
|
}
|
1300
1300
|
get identity() {
|
1301
1301
|
const ret = wasm.buffereddecryptedmessage_identity(this.__wbg_ptr);
|
1302
|
-
return
|
1302
|
+
return WireIdentity.__wrap(ret);
|
1303
1303
|
}
|
1304
1304
|
get crl_new_distribution_points() {
|
1305
1305
|
const ret = wasm.buffereddecryptedmessage_crl_new_distribution_points(this.__wbg_ptr);
|
@@ -2447,12 +2447,16 @@ class WireIdentity {
|
|
2447
2447
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2448
2448
|
}
|
2449
2449
|
}
|
2450
|
-
get
|
2450
|
+
get status() {
|
2451
|
+
const ret = wasm.wireidentity_status(this.__wbg_ptr);
|
2452
|
+
return ret;
|
2453
|
+
}
|
2454
|
+
get thumbprint() {
|
2451
2455
|
let deferred1_0;
|
2452
2456
|
let deferred1_1;
|
2453
2457
|
try {
|
2454
2458
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2455
|
-
wasm.
|
2459
|
+
wasm.wireidentity_thumbprint(retptr, this.__wbg_ptr);
|
2456
2460
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2457
2461
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2458
2462
|
deferred1_0 = r0;
|
@@ -2463,12 +2467,43 @@ class WireIdentity {
|
|
2463
2467
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2464
2468
|
}
|
2465
2469
|
}
|
2466
|
-
get
|
2470
|
+
get credential_type() {
|
2471
|
+
const ret = wasm.wireidentity_credential_type(this.__wbg_ptr);
|
2472
|
+
return ret;
|
2473
|
+
}
|
2474
|
+
get x509_identity() {
|
2475
|
+
const ret = wasm.wireidentity_x509_identity(this.__wbg_ptr);
|
2476
|
+
return ret === 0 ? undefined : X509Identity.__wrap(ret);
|
2477
|
+
}
|
2478
|
+
}
|
2479
|
+
var X509IdentityFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
2480
|
+
}, unregister: () => {
|
2481
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_x509identity_free(ptr >>> 0));
|
2482
|
+
|
2483
|
+
class X509Identity {
|
2484
|
+
static __wrap(ptr) {
|
2485
|
+
ptr = ptr >>> 0;
|
2486
|
+
const obj = Object.create(X509Identity.prototype);
|
2487
|
+
obj.__wbg_ptr = ptr;
|
2488
|
+
X509IdentityFinalization.register(obj, obj.__wbg_ptr, obj);
|
2489
|
+
return obj;
|
2490
|
+
}
|
2491
|
+
__destroy_into_raw() {
|
2492
|
+
const ptr = this.__wbg_ptr;
|
2493
|
+
this.__wbg_ptr = 0;
|
2494
|
+
X509IdentityFinalization.unregister(this);
|
2495
|
+
return ptr;
|
2496
|
+
}
|
2497
|
+
free() {
|
2498
|
+
const ptr = this.__destroy_into_raw();
|
2499
|
+
wasm.__wbg_x509identity_free(ptr);
|
2500
|
+
}
|
2501
|
+
get handle() {
|
2467
2502
|
let deferred1_0;
|
2468
2503
|
let deferred1_1;
|
2469
2504
|
try {
|
2470
2505
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2471
|
-
wasm.
|
2506
|
+
wasm.x509identity_handle(retptr, this.__wbg_ptr);
|
2472
2507
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2473
2508
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2474
2509
|
deferred1_0 = r0;
|
@@ -2479,12 +2514,12 @@ class WireIdentity {
|
|
2479
2514
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2480
2515
|
}
|
2481
2516
|
}
|
2482
|
-
get
|
2517
|
+
get display_name() {
|
2483
2518
|
let deferred1_0;
|
2484
2519
|
let deferred1_1;
|
2485
2520
|
try {
|
2486
2521
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2487
|
-
wasm.
|
2522
|
+
wasm.x509identity_display_name(retptr, this.__wbg_ptr);
|
2488
2523
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2489
2524
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2490
2525
|
deferred1_0 = r0;
|
@@ -2495,12 +2530,12 @@ class WireIdentity {
|
|
2495
2530
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2496
2531
|
}
|
2497
2532
|
}
|
2498
|
-
get
|
2533
|
+
get domain() {
|
2499
2534
|
let deferred1_0;
|
2500
2535
|
let deferred1_1;
|
2501
2536
|
try {
|
2502
2537
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2503
|
-
wasm.
|
2538
|
+
wasm.x509identity_domain(retptr, this.__wbg_ptr);
|
2504
2539
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2505
2540
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2506
2541
|
deferred1_0 = r0;
|
@@ -2511,16 +2546,12 @@ class WireIdentity {
|
|
2511
2546
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
2512
2547
|
}
|
2513
2548
|
}
|
2514
|
-
get
|
2515
|
-
const ret = wasm.wireidentity_status(this.__wbg_ptr);
|
2516
|
-
return ret;
|
2517
|
-
}
|
2518
|
-
get thumbprint() {
|
2549
|
+
get certificate() {
|
2519
2550
|
let deferred1_0;
|
2520
2551
|
let deferred1_1;
|
2521
2552
|
try {
|
2522
2553
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2523
|
-
wasm.
|
2554
|
+
wasm.x509identity_certificate(retptr, this.__wbg_ptr);
|
2524
2555
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2525
2556
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2526
2557
|
deferred1_0 = r0;
|
@@ -2536,7 +2567,7 @@ class WireIdentity {
|
|
2536
2567
|
let deferred1_1;
|
2537
2568
|
try {
|
2538
2569
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
2539
|
-
wasm.
|
2570
|
+
wasm.x509identity_serial_number(retptr, this.__wbg_ptr);
|
2540
2571
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
2541
2572
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
2542
2573
|
deferred1_0 = r0;
|
@@ -2548,11 +2579,11 @@ class WireIdentity {
|
|
2548
2579
|
}
|
2549
2580
|
}
|
2550
2581
|
get not_before() {
|
2551
|
-
const ret = wasm.
|
2582
|
+
const ret = wasm.x509identity_not_before(this.__wbg_ptr);
|
2552
2583
|
return BigInt.asUintN(64, ret);
|
2553
2584
|
}
|
2554
2585
|
get not_after() {
|
2555
|
-
const ret = wasm.
|
2586
|
+
const ret = wasm.x509identity_not_after(this.__wbg_ptr);
|
2556
2587
|
return BigInt.asUintN(64, ret);
|
2557
2588
|
}
|
2558
2589
|
}
|
@@ -2643,12 +2674,21 @@ var mapWireIdentity = (ffiIdentity) => {
|
|
2643
2674
|
}
|
2644
2675
|
return {
|
2645
2676
|
clientId: ffiIdentity.client_id,
|
2677
|
+
status: DeviceStatus2[ffiIdentity.status],
|
2678
|
+
thumbprint: ffiIdentity.thumbprint,
|
2679
|
+
credentialType: CredentialType2[ffiIdentity.credential_type],
|
2680
|
+
x509Identity: mapX509Identity(ffiIdentity.x509_identity)
|
2681
|
+
};
|
2682
|
+
};
|
2683
|
+
var mapX509Identity = (ffiIdentity) => {
|
2684
|
+
if (!ffiIdentity) {
|
2685
|
+
return;
|
2686
|
+
}
|
2687
|
+
return {
|
2646
2688
|
handle: ffiIdentity.handle,
|
2647
2689
|
displayName: ffiIdentity.display_name,
|
2648
2690
|
domain: ffiIdentity.domain,
|
2649
2691
|
certificate: ffiIdentity.certificate,
|
2650
|
-
status: DeviceStatus2[ffiIdentity.status],
|
2651
|
-
thumbprint: ffiIdentity.thumbprint,
|
2652
2692
|
serialNumber: ffiIdentity.serial_number,
|
2653
2693
|
notBefore: ffiIdentity.not_before,
|
2654
2694
|
notAfter: ffiIdentity.not_after
|