@bitwarden/sdk-internal 0.2.0-main.167 → 0.2.0-main.168

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 CHANGED
@@ -1 +1 @@
1
- d5efd048c48b9907220ed2dd0b15690091dc991d
1
+ 0b95464f8dc591cd00f1d8b25d4ad293b4d6580a
@@ -1256,15 +1256,52 @@ export class PureCrypto {
1256
1256
  email: string,
1257
1257
  kdf: Kdf,
1258
1258
  ): string;
1259
- static generate_user_key_aes256_cbc_hmac(): Uint8Array;
1260
- static generate_user_key_xchacha20_poly1305(): Uint8Array;
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,
@@ -2384,10 +2384,10 @@ export class PureCrypto {
2384
2384
  /**
2385
2385
  * @returns {Uint8Array}
2386
2386
  */
2387
- static generate_user_key_aes256_cbc_hmac() {
2387
+ static make_user_key_aes256_cbc_hmac() {
2388
2388
  try {
2389
2389
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2390
- wasm.purecrypto_generate_user_key_aes256_cbc_hmac(retptr);
2390
+ wasm.purecrypto_make_user_key_aes256_cbc_hmac(retptr);
2391
2391
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2392
2392
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2393
2393
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
@@ -2400,10 +2400,10 @@ export class PureCrypto {
2400
2400
  /**
2401
2401
  * @returns {Uint8Array}
2402
2402
  */
2403
- static generate_user_key_xchacha20_poly1305() {
2403
+ static make_user_key_xchacha20_poly1305() {
2404
2404
  try {
2405
2405
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2406
- wasm.purecrypto_generate_user_key_xchacha20_poly1305(retptr);
2406
+ wasm.purecrypto_make_user_key_xchacha20_poly1305(retptr);
2407
2407
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2408
2408
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2409
2409
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
@@ -2414,6 +2414,8 @@ export class PureCrypto {
2414
2414
  }
2415
2415
  }
2416
2416
  /**
2417
+ * Wraps (encrypts) a symmetric key using a symmetric wrapping key, returning the wrapped key
2418
+ * as an EncString.
2417
2419
  * @param {Uint8Array} key_to_be_wrapped
2418
2420
  * @param {Uint8Array} wrapping_key
2419
2421
  * @returns {string}
@@ -2448,6 +2450,8 @@ export class PureCrypto {
2448
2450
  }
2449
2451
  }
2450
2452
  /**
2453
+ * Unwraps (decrypts) a wrapped symmetric key using a symmetric wrapping key, returning the
2454
+ * unwrapped key as a serialized byte array.
2451
2455
  * @param {string} wrapped_key
2452
2456
  * @param {Uint8Array} wrapping_key
2453
2457
  * @returns {Uint8Array}
@@ -2475,6 +2479,11 @@ export class PureCrypto {
2475
2479
  }
2476
2480
  }
2477
2481
  /**
2482
+ * Wraps (encrypts) an SPKI DER encoded encapsulation (public) key using a symmetric wrapping
2483
+ * key. Note: Usually, a public key is - by definition - public, so this should not be
2484
+ * used. The specific use-case for this function is to enable rotateable key sets, where
2485
+ * the "public key" is not public, with the intent of preventing the server from being able
2486
+ * to overwrite the user key unlocked by the rotateable keyset.
2478
2487
  * @param {Uint8Array} encapsulation_key
2479
2488
  * @param {Uint8Array} wrapping_key
2480
2489
  * @returns {string}
@@ -2509,6 +2518,8 @@ export class PureCrypto {
2509
2518
  }
2510
2519
  }
2511
2520
  /**
2521
+ * Unwraps (decrypts) a wrapped SPKI DER encoded encapsulation (public) key using a symmetric
2522
+ * wrapping key.
2512
2523
  * @param {string} wrapped_key
2513
2524
  * @param {Uint8Array} wrapping_key
2514
2525
  * @returns {Uint8Array}
@@ -2536,6 +2547,8 @@ export class PureCrypto {
2536
2547
  }
2537
2548
  }
2538
2549
  /**
2550
+ * Wraps (encrypts) a PKCS8 DER encoded decapsulation (private) key using a symmetric wrapping
2551
+ * key,
2539
2552
  * @param {Uint8Array} decapsulation_key
2540
2553
  * @param {Uint8Array} wrapping_key
2541
2554
  * @returns {string}
@@ -2570,6 +2583,8 @@ export class PureCrypto {
2570
2583
  }
2571
2584
  }
2572
2585
  /**
2586
+ * Unwraps (decrypts) a wrapped PKCS8 DER encoded decapsulation (private) key using a symmetric
2587
+ * wrapping key.
2573
2588
  * @param {string} wrapped_key
2574
2589
  * @param {Uint8Array} wrapping_key
2575
2590
  * @returns {Uint8Array}
@@ -2597,6 +2612,9 @@ export class PureCrypto {
2597
2612
  }
2598
2613
  }
2599
2614
  /**
2615
+ * Encapsulates (encrypts) a symmetric key using an asymmetric encapsulation key (public key)
2616
+ * in SPKI format, returning the encapsulated key as a string. Note: This is unsigned, so
2617
+ * the sender's authenticity cannot be verified by the recipient.
2600
2618
  * @param {Uint8Array} shared_key
2601
2619
  * @param {Uint8Array} encapsulation_key
2602
2620
  * @returns {string}
@@ -2631,6 +2649,9 @@ export class PureCrypto {
2631
2649
  }
2632
2650
  }
2633
2651
  /**
2652
+ * Decapsulates (decrypts) a symmetric key using an decapsulation key (private key) in PKCS8
2653
+ * DER format. Note: This is unsigned, so the sender's authenticity cannot be verified by the
2654
+ * recipient.
2634
2655
  * @param {string} encapsulated_key
2635
2656
  * @param {Uint8Array} decapsulation_key
2636
2657
  * @returns {Uint8Array}
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 purecrypto_generate_user_key_aes256_cbc_hmac: (a: number) => void;
196
- export const purecrypto_generate_user_key_xchacha20_poly1305: (a: number) => void;
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,