@bitwarden/sdk-internal 0.2.0-main.397 → 0.2.0-main.398

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.
@@ -2423,6 +2423,14 @@ export class PureCrypto {
2423
2423
  encrypted_user_key: string,
2424
2424
  master_key: Uint8Array,
2425
2425
  ): Uint8Array;
2426
+ /**
2427
+ * Given an encrypted private RSA key and the symmetric key it is wrapped with, this returns
2428
+ * the corresponding public RSA key in DER format.
2429
+ */
2430
+ static rsa_extract_public_key(
2431
+ encrypted_private_key: string,
2432
+ wrapping_key: Uint8Array,
2433
+ ): Uint8Array;
2426
2434
  }
2427
2435
  /**
2428
2436
  * The `SendAccessClient` is used to interact with the Bitwarden API to get send access tokens.
@@ -858,14 +858,6 @@ exports.isEncryptFileError = function (error) {
858
858
  }
859
859
  };
860
860
 
861
- function wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5(arg0, arg1, arg2) {
862
- wasm.wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5(
863
- arg0,
864
- arg1,
865
- addHeapObject(arg2),
866
- );
867
- }
868
-
869
861
  function wasm_bindgen__convert__closures_____invoke__h1a8786b7bd5c2cf5(arg0, arg1, arg2) {
870
862
  try {
871
863
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
@@ -885,6 +877,14 @@ function wasm_bindgen__convert__closures_____invoke__h1a8786b7bd5c2cf5(arg0, arg
885
877
  }
886
878
  }
887
879
 
880
+ function wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5(arg0, arg1, arg2) {
881
+ wasm.wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5(
882
+ arg0,
883
+ arg1,
884
+ addHeapObject(arg2),
885
+ );
886
+ }
887
+
888
888
  function wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e(arg0, arg1) {
889
889
  wasm.wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e(arg0, arg1);
890
890
  }
@@ -4039,6 +4039,39 @@ class PureCrypto {
4039
4039
  wasm.__wbindgen_add_to_stack_pointer(16);
4040
4040
  }
4041
4041
  }
4042
+ /**
4043
+ * Given an encrypted private RSA key and the symmetric key it is wrapped with, this returns
4044
+ * the corresponding public RSA key in DER format.
4045
+ * @param {string} encrypted_private_key
4046
+ * @param {Uint8Array} wrapping_key
4047
+ * @returns {Uint8Array}
4048
+ */
4049
+ static rsa_extract_public_key(encrypted_private_key, wrapping_key) {
4050
+ try {
4051
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4052
+ const ptr0 = passStringToWasm0(
4053
+ encrypted_private_key,
4054
+ wasm.__wbindgen_malloc,
4055
+ wasm.__wbindgen_realloc,
4056
+ );
4057
+ const len0 = WASM_VECTOR_LEN;
4058
+ const ptr1 = passArray8ToWasm0(wrapping_key, wasm.__wbindgen_malloc);
4059
+ const len1 = WASM_VECTOR_LEN;
4060
+ wasm.purecrypto_rsa_extract_public_key(retptr, ptr0, len0, ptr1, len1);
4061
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4062
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4063
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
4064
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
4065
+ if (r3) {
4066
+ throw takeObject(r2);
4067
+ }
4068
+ var v3 = getArrayU8FromWasm0(r0, r1).slice();
4069
+ wasm.__wbindgen_free(r0, r1 * 1, 1);
4070
+ return v3;
4071
+ } finally {
4072
+ wasm.__wbindgen_add_to_stack_pointer(16);
4073
+ }
4074
+ }
4042
4075
  }
4043
4076
  if (Symbol.dispose) PureCrypto.prototype[Symbol.dispose] = PureCrypto.prototype.free;
4044
4077
 
@@ -4466,7 +4499,7 @@ exports.__wbg_call_e762c39fa8ea36bf = function () {
4466
4499
  }, arguments);
4467
4500
  };
4468
4501
 
4469
- exports.__wbg_cipher_0196bd196ae59e2c = function (arg0) {
4502
+ exports.__wbg_cipher_27b0aefec8023efb = function (arg0) {
4470
4503
  const ret = getObject(arg0).cipher;
4471
4504
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4472
4505
  };
@@ -4559,7 +4592,7 @@ exports.__wbg_fetch_f8ba0e29a9d6de0d = function (arg0, arg1) {
4559
4592
  return addHeapObject(ret);
4560
4593
  };
4561
4594
 
4562
- exports.__wbg_folder_7ad956677c62f008 = function (arg0) {
4595
+ exports.__wbg_folder_d6a2d6a9d32f3686 = function (arg0) {
4563
4596
  const ret = getObject(arg0).folder;
4564
4597
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
4565
4598
  };
@@ -4586,7 +4619,7 @@ exports.__wbg_getTime_14776bfb48a1bff9 = function (arg0) {
4586
4619
  return ret;
4587
4620
  };
4588
4621
 
4589
- exports.__wbg_get_7775c3e3ae3bcefd = function () {
4622
+ exports.__wbg_get_70485431d7544ae5 = function () {
4590
4623
  return handleError(function (arg0, arg1, arg2) {
4591
4624
  let deferred0_0;
4592
4625
  let deferred0_1;
@@ -4606,19 +4639,12 @@ exports.__wbg_get_7bed016f185add81 = function (arg0, arg1) {
4606
4639
  return addHeapObject(ret);
4607
4640
  };
4608
4641
 
4609
- exports.__wbg_get_access_token_1de03e544708805a = function (arg0) {
4642
+ exports.__wbg_get_access_token_048717a0999058da = function (arg0) {
4610
4643
  const ret = getObject(arg0).get_access_token();
4611
4644
  return addHeapObject(ret);
4612
4645
  };
4613
4646
 
4614
- exports.__wbg_get_efcb449f58ec27c2 = function () {
4615
- return handleError(function (arg0, arg1) {
4616
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
4617
- return addHeapObject(ret);
4618
- }, arguments);
4619
- };
4620
-
4621
- exports.__wbg_get_f836288e48750d27 = function () {
4647
+ exports.__wbg_get_bd5598ce2fa61fe7 = function () {
4622
4648
  return handleError(function (arg0, arg1, arg2) {
4623
4649
  let deferred0_0;
4624
4650
  let deferred0_1;
@@ -4633,6 +4659,13 @@ exports.__wbg_get_f836288e48750d27 = function () {
4633
4659
  }, arguments);
4634
4660
  };
4635
4661
 
4662
+ exports.__wbg_get_efcb449f58ec27c2 = function () {
4663
+ return handleError(function (arg0, arg1) {
4664
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
4665
+ return addHeapObject(ret);
4666
+ }, arguments);
4667
+ };
4668
+
4636
4669
  exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function (arg0, arg1) {
4637
4670
  const ret = getObject(arg0)[getObject(arg1)];
4638
4671
  return addHeapObject(ret);
@@ -4817,14 +4850,14 @@ exports.__wbg_length_cdd215e10d9dd507 = function (arg0) {
4817
4850
  return ret;
4818
4851
  };
4819
4852
 
4820
- exports.__wbg_list_a25d56a0eba748af = function () {
4853
+ exports.__wbg_list_4789a1cc32867476 = function () {
4821
4854
  return handleError(function (arg0) {
4822
4855
  const ret = getObject(arg0).list();
4823
4856
  return addHeapObject(ret);
4824
4857
  }, arguments);
4825
4858
  };
4826
4859
 
4827
- exports.__wbg_list_a618bae756003515 = function () {
4860
+ exports.__wbg_list_65a7f325af23cc73 = function () {
4828
4861
  return handleError(function (arg0) {
4829
4862
  const ret = getObject(arg0).list();
4830
4863
  return addHeapObject(ret);
@@ -5068,7 +5101,7 @@ exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
5068
5101
  }, arguments);
5069
5102
  };
5070
5103
 
5071
- exports.__wbg_remove_6e0b8907d2143b2a = function () {
5104
+ exports.__wbg_remove_0825e8a0ec895d58 = function () {
5072
5105
  return handleError(function (arg0, arg1, arg2) {
5073
5106
  let deferred0_0;
5074
5107
  let deferred0_1;
@@ -5083,7 +5116,7 @@ exports.__wbg_remove_6e0b8907d2143b2a = function () {
5083
5116
  }, arguments);
5084
5117
  };
5085
5118
 
5086
- exports.__wbg_remove_a3355f80824bccaa = function () {
5119
+ exports.__wbg_remove_ce09ed4fa7b19fbf = function () {
5087
5120
  return handleError(function (arg0, arg1, arg2) {
5088
5121
  let deferred0_0;
5089
5122
  let deferred0_1;
@@ -5133,7 +5166,31 @@ exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
5133
5166
  getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
5134
5167
  };
5135
5168
 
5136
- exports.__wbg_set_4f10240cec7c0329 = function () {
5169
+ exports.__wbg_set_907fb406c34a251d = function (arg0, arg1, arg2) {
5170
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
5171
+ return addHeapObject(ret);
5172
+ };
5173
+
5174
+ exports.__wbg_set_body_3c365989753d61f4 = function (arg0, arg1) {
5175
+ getObject(arg0).body = getObject(arg1);
5176
+ };
5177
+
5178
+ exports.__wbg_set_c213c871859d6500 = function (arg0, arg1, arg2) {
5179
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
5180
+ };
5181
+
5182
+ exports.__wbg_set_c2abbebe8b9ebee1 = function () {
5183
+ return handleError(function (arg0, arg1, arg2) {
5184
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
5185
+ return ret;
5186
+ }, arguments);
5187
+ };
5188
+
5189
+ exports.__wbg_set_credentials_f621cd2d85c0c228 = function (arg0, arg1) {
5190
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
5191
+ };
5192
+
5193
+ exports.__wbg_set_e12e8ea9f0a95d29 = function () {
5137
5194
  return handleError(function (arg0, arg1, arg2, arg3) {
5138
5195
  let deferred0_0;
5139
5196
  let deferred0_1;
@@ -5148,7 +5205,7 @@ exports.__wbg_set_4f10240cec7c0329 = function () {
5148
5205
  }, arguments);
5149
5206
  };
5150
5207
 
5151
- exports.__wbg_set_8bf42eeed138232a = function () {
5208
+ exports.__wbg_set_e4af713e5ff898d5 = function () {
5152
5209
  return handleError(function (arg0, arg1, arg2, arg3) {
5153
5210
  let deferred0_0;
5154
5211
  let deferred0_1;
@@ -5163,30 +5220,6 @@ exports.__wbg_set_8bf42eeed138232a = function () {
5163
5220
  }, arguments);
5164
5221
  };
5165
5222
 
5166
- exports.__wbg_set_907fb406c34a251d = function (arg0, arg1, arg2) {
5167
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
5168
- return addHeapObject(ret);
5169
- };
5170
-
5171
- exports.__wbg_set_body_3c365989753d61f4 = function (arg0, arg1) {
5172
- getObject(arg0).body = getObject(arg1);
5173
- };
5174
-
5175
- exports.__wbg_set_c213c871859d6500 = function (arg0, arg1, arg2) {
5176
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
5177
- };
5178
-
5179
- exports.__wbg_set_c2abbebe8b9ebee1 = function () {
5180
- return handleError(function (arg0, arg1, arg2) {
5181
- const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
5182
- return ret;
5183
- }, arguments);
5184
- };
5185
-
5186
- exports.__wbg_set_credentials_f621cd2d85c0c228 = function (arg0, arg1) {
5187
- getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
5188
- };
5189
-
5190
5223
  exports.__wbg_set_headers_6926da238cd32ee4 = function (arg0, arg1) {
5191
5224
  getObject(arg0).headers = getObject(arg1);
5192
5225
  };
@@ -177,6 +177,13 @@ export const purecrypto_decrypt_user_key_with_master_key: (
177
177
  d: number,
178
178
  e: number,
179
179
  ) => void;
180
+ export const purecrypto_rsa_extract_public_key: (
181
+ a: number,
182
+ b: number,
183
+ c: number,
184
+ d: number,
185
+ e: number,
186
+ ) => void;
180
187
  export const generate_ssh_key: (a: number, b: number) => void;
181
188
  export const import_ssh_key: (a: number, b: number, c: number, d: number, e: number) => void;
182
189
  export const isTestError: (a: number) => number;
@@ -431,24 +438,24 @@ export const __wbg_totpclient_free: (a: number, b: number) => void;
431
438
  export const __wbg_get_outgoingmessage_destination: (a: number) => number;
432
439
  export const __wbg_set_outgoingmessage_destination: (a: number, b: number) => void;
433
440
  export const __wbg_cryptoclient_free: (a: number, b: number) => void;
434
- export const wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5: (
441
+ export const wasm_bindgen__convert__closures_____invoke__h1a8786b7bd5c2cf5: (
435
442
  a: number,
436
443
  b: number,
437
444
  c: number,
445
+ d: number,
438
446
  ) => void;
439
447
  export const wasm_bindgen__closure__destroy__h1470697583ce3ba3: (a: number, b: number) => void;
440
- export const wasm_bindgen__convert__closures_____invoke__h1a8786b7bd5c2cf5: (
448
+ export const wasm_bindgen__convert__closures_____invoke__hdc41283f124c06e5: (
441
449
  a: number,
442
450
  b: number,
443
451
  c: number,
444
- d: number,
445
452
  ) => void;
446
453
  export const wasm_bindgen__convert__closures_____invoke__h092300064b8afb1e: (
447
454
  a: number,
448
455
  b: number,
449
456
  ) => void;
450
- export const wasm_bindgen__closure__destroy__h5bf455f3385c4f71: (a: number, b: number) => void;
451
457
  export const wasm_bindgen__closure__destroy__hfcb631b72e5e985c: (a: number, b: number) => void;
458
+ export const wasm_bindgen__closure__destroy__h5bf455f3385c4f71: (a: number, b: number) => void;
452
459
  export const wasm_bindgen__convert__closures_____invoke__h43dfd80678632d6f: (
453
460
  a: number,
454
461
  b: number,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitwarden/sdk-internal",
3
- "version": "0.2.0-main.397",
3
+ "version": "0.2.0-main.398",
4
4
  "license": "GPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",