@bitwarden/sdk-internal 0.2.0-main.167 → 0.2.0-main.169
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/VERSION +1 -1
- package/bitwarden_wasm_internal.d.ts +39 -2
- package/bitwarden_wasm_internal_bg.js +29 -8
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +3 -3
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +39 -2
- package/node/bitwarden_wasm_internal.js +29 -8
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1256,15 +1256,52 @@ export class PureCrypto {
|
|
|
1256
1256
|
email: string,
|
|
1257
1257
|
kdf: Kdf,
|
|
1258
1258
|
): string;
|
|
1259
|
-
static
|
|
1260
|
-
static
|
|
1259
|
+
static make_user_key_aes256_cbc_hmac(): Uint8Array;
|
|
1260
|
+
static make_user_key_xchacha20_poly1305(): Uint8Array;
|
|
1261
|
+
/**
|
|
1262
|
+
* Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
|
|
1263
|
+
* as an EncString.
|
|
1264
|
+
*/
|
|
1261
1265
|
static wrap_symmetric_key(key_to_be_wrapped: Uint8Array, wrapping_key: Uint8Array): string;
|
|
1266
|
+
/**
|
|
1267
|
+
* Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
|
|
1268
|
+
* unwrapped key as a serialized byte array.
|
|
1269
|
+
*/
|
|
1262
1270
|
static unwrap_symmetric_key(wrapped_key: string, wrapping_key: Uint8Array): Uint8Array;
|
|
1271
|
+
/**
|
|
1272
|
+
* Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
|
|
1273
|
+
* key. Note: Usually, a public key is - by definition - public, so this should not be
|
|
1274
|
+
* used. The specific use-case for this function is to enable rotateable key sets, where
|
|
1275
|
+
* the "public key" is not public, with the intent of preventing the server from being able
|
|
1276
|
+
* to overwrite the user key unlocked by the rotateable keyset.
|
|
1277
|
+
*/
|
|
1263
1278
|
static wrap_encapsulation_key(encapsulation_key: Uint8Array, wrapping_key: Uint8Array): string;
|
|
1279
|
+
/**
|
|
1280
|
+
* Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
|
|
1281
|
+
* wrapping key.
|
|
1282
|
+
*/
|
|
1264
1283
|
static unwrap_encapsulation_key(wrapped_key: string, wrapping_key: Uint8Array): Uint8Array;
|
|
1284
|
+
/**
|
|
1285
|
+
* Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
|
|
1286
|
+
* key,
|
|
1287
|
+
*/
|
|
1265
1288
|
static wrap_decapsulation_key(decapsulation_key: Uint8Array, wrapping_key: Uint8Array): string;
|
|
1289
|
+
/**
|
|
1290
|
+
* Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
|
|
1291
|
+
* wrapping key.
|
|
1292
|
+
*/
|
|
1266
1293
|
static unwrap_decapsulation_key(wrapped_key: string, wrapping_key: Uint8Array): Uint8Array;
|
|
1294
|
+
/**
|
|
1295
|
+
* Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
|
|
1296
|
+
* in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
|
|
1297
|
+
* the sender's authenticity cannot be verified by the recipient.
|
|
1298
|
+
*/
|
|
1267
1299
|
static encapsulate_key_unsigned(shared_key: Uint8Array, encapsulation_key: Uint8Array): string;
|
|
1300
|
+
/**
|
|
1301
|
+
* Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
|
|
1302
|
+
* DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
|
|
1303
|
+
* recipient.
|
|
1304
|
+
*/
|
|
1268
1305
|
static decapsulate_key_unsigned(
|
|
1269
1306
|
encapsulated_key: string,
|
|
1270
1307
|
decapsulation_key: Uint8Array,
|
|
@@ -2390,10 +2390,10 @@ class PureCrypto {
|
|
|
2390
2390
|
/**
|
|
2391
2391
|
* @returns {Uint8Array}
|
|
2392
2392
|
*/
|
|
2393
|
-
static
|
|
2393
|
+
static make_user_key_aes256_cbc_hmac() {
|
|
2394
2394
|
try {
|
|
2395
2395
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2396
|
-
wasm.
|
|
2396
|
+
wasm.purecrypto_make_user_key_aes256_cbc_hmac(retptr);
|
|
2397
2397
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2398
2398
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2399
2399
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
@@ -2406,10 +2406,10 @@ class PureCrypto {
|
|
|
2406
2406
|
/**
|
|
2407
2407
|
* @returns {Uint8Array}
|
|
2408
2408
|
*/
|
|
2409
|
-
static
|
|
2409
|
+
static make_user_key_xchacha20_poly1305() {
|
|
2410
2410
|
try {
|
|
2411
2411
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2412
|
-
wasm.
|
|
2412
|
+
wasm.purecrypto_make_user_key_xchacha20_poly1305(retptr);
|
|
2413
2413
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2414
2414
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2415
2415
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
@@ -2420,6 +2420,8 @@ class PureCrypto {
|
|
|
2420
2420
|
}
|
|
2421
2421
|
}
|
|
2422
2422
|
/**
|
|
2423
|
+
* Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
|
|
2424
|
+
* as an EncString.
|
|
2423
2425
|
* @param {Uint8Array} key_to_be_wrapped
|
|
2424
2426
|
* @param {Uint8Array} wrapping_key
|
|
2425
2427
|
* @returns {string}
|
|
@@ -2454,6 +2456,8 @@ class PureCrypto {
|
|
|
2454
2456
|
}
|
|
2455
2457
|
}
|
|
2456
2458
|
/**
|
|
2459
|
+
* Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
|
|
2460
|
+
* unwrapped key as a serialized byte array.
|
|
2457
2461
|
* @param {string} wrapped_key
|
|
2458
2462
|
* @param {Uint8Array} wrapping_key
|
|
2459
2463
|
* @returns {Uint8Array}
|
|
@@ -2481,6 +2485,11 @@ class PureCrypto {
|
|
|
2481
2485
|
}
|
|
2482
2486
|
}
|
|
2483
2487
|
/**
|
|
2488
|
+
* Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
|
|
2489
|
+
* key. Note: Usually, a public key is - by definition - public, so this should not be
|
|
2490
|
+
* used. The specific use-case for this function is to enable rotateable key sets, where
|
|
2491
|
+
* the "public key" is not public, with the intent of preventing the server from being able
|
|
2492
|
+
* to overwrite the user key unlocked by the rotateable keyset.
|
|
2484
2493
|
* @param {Uint8Array} encapsulation_key
|
|
2485
2494
|
* @param {Uint8Array} wrapping_key
|
|
2486
2495
|
* @returns {string}
|
|
@@ -2515,6 +2524,8 @@ class PureCrypto {
|
|
|
2515
2524
|
}
|
|
2516
2525
|
}
|
|
2517
2526
|
/**
|
|
2527
|
+
* Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
|
|
2528
|
+
* wrapping key.
|
|
2518
2529
|
* @param {string} wrapped_key
|
|
2519
2530
|
* @param {Uint8Array} wrapping_key
|
|
2520
2531
|
* @returns {Uint8Array}
|
|
@@ -2542,6 +2553,8 @@ class PureCrypto {
|
|
|
2542
2553
|
}
|
|
2543
2554
|
}
|
|
2544
2555
|
/**
|
|
2556
|
+
* Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
|
|
2557
|
+
* key,
|
|
2545
2558
|
* @param {Uint8Array} decapsulation_key
|
|
2546
2559
|
* @param {Uint8Array} wrapping_key
|
|
2547
2560
|
* @returns {string}
|
|
@@ -2576,6 +2589,8 @@ class PureCrypto {
|
|
|
2576
2589
|
}
|
|
2577
2590
|
}
|
|
2578
2591
|
/**
|
|
2592
|
+
* Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
|
|
2593
|
+
* wrapping key.
|
|
2579
2594
|
* @param {string} wrapped_key
|
|
2580
2595
|
* @param {Uint8Array} wrapping_key
|
|
2581
2596
|
* @returns {Uint8Array}
|
|
@@ -2603,6 +2618,9 @@ class PureCrypto {
|
|
|
2603
2618
|
}
|
|
2604
2619
|
}
|
|
2605
2620
|
/**
|
|
2621
|
+
* Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
|
|
2622
|
+
* in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
|
|
2623
|
+
* the sender's authenticity cannot be verified by the recipient.
|
|
2606
2624
|
* @param {Uint8Array} shared_key
|
|
2607
2625
|
* @param {Uint8Array} encapsulation_key
|
|
2608
2626
|
* @returns {string}
|
|
@@ -2637,6 +2655,9 @@ class PureCrypto {
|
|
|
2637
2655
|
}
|
|
2638
2656
|
}
|
|
2639
2657
|
/**
|
|
2658
|
+
* Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
|
|
2659
|
+
* DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
|
|
2660
|
+
* recipient.
|
|
2640
2661
|
* @param {string} encapsulated_key
|
|
2641
2662
|
* @param {Uint8Array} decapsulation_key
|
|
2642
2663
|
* @returns {Uint8Array}
|
|
@@ -3553,13 +3574,13 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
|
|
|
3553
3574
|
return ret;
|
|
3554
3575
|
};
|
|
3555
3576
|
|
|
3556
|
-
module.exports.
|
|
3557
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3577
|
+
module.exports.__wbindgen_closure_wrapper3078 = function (arg0, arg1, arg2) {
|
|
3578
|
+
const ret = makeMutClosure(arg0, arg1, 705, __wbg_adapter_50);
|
|
3558
3579
|
return addHeapObject(ret);
|
|
3559
3580
|
};
|
|
3560
3581
|
|
|
3561
|
-
module.exports.
|
|
3562
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3582
|
+
module.exports.__wbindgen_closure_wrapper3473 = function (arg0, arg1, arg2) {
|
|
3583
|
+
const ret = makeMutClosure(arg0, arg1, 827, __wbg_adapter_53);
|
|
3563
3584
|
return addHeapObject(ret);
|
|
3564
3585
|
};
|
|
3565
3586
|
|
|
Binary file
|
|
@@ -192,8 +192,8 @@ export const purecrypto_encrypt_user_key_with_master_password: (
|
|
|
192
192
|
g: number,
|
|
193
193
|
h: number,
|
|
194
194
|
) => void;
|
|
195
|
-
export const
|
|
196
|
-
export const
|
|
195
|
+
export const purecrypto_make_user_key_aes256_cbc_hmac: (a: number) => void;
|
|
196
|
+
export const purecrypto_make_user_key_xchacha20_poly1305: (a: number) => void;
|
|
197
197
|
export const purecrypto_wrap_symmetric_key: (
|
|
198
198
|
a: number,
|
|
199
199
|
b: number,
|
|
@@ -284,10 +284,10 @@ export const purecrypto_wrap_encapsulation_key: (
|
|
|
284
284
|
e: number,
|
|
285
285
|
) => void;
|
|
286
286
|
export const __wbg_vaultclient_free: (a: number, b: number) => void;
|
|
287
|
+
export const __wbg_totpclient_free: (a: number, b: number) => void;
|
|
287
288
|
export const __wbg_foldersclient_free: (a: number, b: number) => void;
|
|
288
289
|
export const __wbg_cryptoclient_free: (a: number, b: number) => void;
|
|
289
290
|
export const __wbg_ciphersclient_free: (a: number, b: number) => void;
|
|
290
|
-
export const __wbg_totpclient_free: (a: number, b: number) => void;
|
|
291
291
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
292
292
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
293
293
|
export const __wbindgen_exn_store: (a: number) => void;
|