tabris 3.9.0-dev.20240205 → 3.9.0-dev.20240206

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/boot.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Tabris.js 3.9.0-dev.20240205+0311
2
+ * Tabris.js 3.9.0-dev.20240206+0311
3
3
  *
4
4
  * Copyright (c) 2014, 2020 EclipseSource Inc.
5
5
  * All rights reserved.
package/globals.d.ts CHANGED
@@ -1053,22 +1053,27 @@ declare class SubtleCrypto {
1053
1053
  encrypt(algorithm: {name: 'AES-GCM', iv: ArrayBuffer | TypedArray, tagLength?: number}, key: CryptoKey, data: ArrayBuffer | TypedArray): Promise<ArrayBuffer>;
1054
1054
 
1055
1055
  /**
1056
- * Converts a CryptoKey instances into a portable format. To export a key, the key must have extractable
1057
- * set to true. Supports the spki format or raw bytes.
1056
+ * Converts `CryptoKey` instances into a portable format. If the key's `extractable` is set to `true`,
1057
+ * returns the raw key material in SPKI format or as raw bytes. If the key's `extractable` is set to
1058
+ * `false`, for ECDSA and ECDH keys returns an opaque handle to the key in the device's trusted
1059
+ * execution environment, and throws for other key formats.
1058
1060
  * @param format
1059
1061
  * @param key
1060
1062
  */
1061
- exportKey(format: 'raw' | 'spki' | 'teeKeyHandle', key: CryptoKey): Promise<ArrayBuffer>;
1063
+ exportKey(format: 'raw' | 'spki', key: CryptoKey): Promise<ArrayBuffer>;
1062
1064
 
1063
1065
  /**
1064
- * Generates new keys. Currently only supports the Elliptic Curve Diffie-Hellman (ECDH) algorithm to
1065
- * generate key pairs.
1066
+ * Generates new keys. Currently only supports the Elliptic Curve Diffie-Hellman (ECDH) and Elliptic
1067
+ * Curve Digital Signature Algorithm (ECDSA) algorithms to generate key pairs. When `extractable` is set
1068
+ * to `true`, the raw key material can be exported using `exportKey`. When `extractable` is set to
1069
+ * `false`, for ECDSA and ECDH keys `exportKey` returns an opaque handle to the key in the device's
1070
+ * trusted execution environment, and throws for other key formats.
1066
1071
  * @param algorithm
1067
1072
  * @param extractable
1068
1073
  * @param keyUsages
1069
1074
  * @param options
1070
1075
  */
1071
- generateKey(algorithm: {name: 'ECDH' | 'ECDSA', namedCurve: 'P-256'}, extractable: boolean, keyUsages: string[], options?: {inTee?: boolean, usageRequiresAuth?: boolean}): Promise<{privateKey: CryptoKey, publicKey: CryptoKey}>;
1076
+ generateKey(algorithm: {name: 'ECDH' | 'ECDSA', namedCurve: 'P-256'}, extractable: boolean, keyUsages: string[], options?: {usageRequiresAuth?: boolean}): Promise<{privateKey: CryptoKey, publicKey: CryptoKey}>;
1072
1077
 
1073
1078
  /**
1074
1079
  * Takes an external key in a portable format and returns a CryptoKey object that can be used with the
@@ -1079,7 +1084,7 @@ declare class SubtleCrypto {
1079
1084
  * @param extractable
1080
1085
  * @param keyUsages
1081
1086
  */
1082
- importKey(format: 'spki' | 'pkcs8' | 'raw' | 'teeKeyHandle', keyData: ArrayBuffer | TypedArray, algorithm: {name: 'ECDH' | 'ECDSA', namedCurve: 'P-256'} | {name: 'AES-GCM'} | 'HKDF' | 'AES-GCM', extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
1087
+ importKey(format: 'spki' | 'pkcs8' | 'raw', keyData: ArrayBuffer | TypedArray, algorithm: {name: 'ECDH' | 'ECDSA', namedCurve: 'P-256'} | {name: 'AES-GCM'} | 'HKDF' | 'AES-GCM', extractable: boolean, keyUsages: string[]): Promise<CryptoKey>;
1083
1088
 
1084
1089
  /**
1085
1090
  * Signs the given data. Currently only supports creating ECDSA signatures in DER format.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabris",
3
- "version": "3.9.0-dev.20240205+0311",
3
+ "version": "3.9.0-dev.20240206+0311",
4
4
  "description": "Mobile apps with native UIs in JavaScript",
5
5
  "keywords": [
6
6
  "native",
package/tabris.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Tabris.js 3.9.0-dev.20240205+0311
1
+ // Type definitions for Tabris.js 3.9.0-dev.20240206+0311
2
2
  /// <reference path="globals.d.ts" />
3
3
 
4
4
  // General helper types
package/tabris.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Tabris.js 3.9.0-dev.20240205+0311
2
+ * Tabris.js 3.9.0-dev.20240206+0311
3
3
  *
4
4
  * Copyright (c) 2014, 2020 EclipseSource Inc.
5
5
  * All rights reserved.
@@ -5034,7 +5034,7 @@ class Tabris extends NativeObject {
5034
5034
  this.$publishProxies();
5035
5035
  }
5036
5036
  get version() {
5037
- return '3.9.0-dev.20240205+0311';
5037
+ return '3.9.0-dev.20240206+0311';
5038
5038
  }
5039
5039
  get started() {
5040
5040
  return !!this._started;
@@ -10485,13 +10485,12 @@ class _CryptoKey extends NativeObject {
10485
10485
  });
10486
10486
  });
10487
10487
  }
10488
- generate(algorithm, extractable, keyUsages, inTee, usageRequiresAuth) {
10488
+ generate(algorithm, extractable, keyUsages, usageRequiresAuth) {
10489
10489
  return __awaiter(this, void 0, void 0, function* () {
10490
10490
  return new Promise$1((onSuccess, onError) => this._nativeCall('generate', {
10491
10491
  algorithm,
10492
10492
  extractable,
10493
10493
  keyUsages,
10494
- inTee,
10495
10494
  usageRequiresAuth,
10496
10495
  onSuccess,
10497
10496
  onError: wrapErrorCb(onError)
@@ -10552,7 +10551,7 @@ class SubtleCrypto {
10552
10551
  if (arguments.length !== 5) {
10553
10552
  throw new TypeError(`Expected 5 arguments, got ${arguments.length}`);
10554
10553
  }
10555
- allowOnlyValues(format, ['spki', 'pkcs8', 'raw', 'teeKeyHandle'], 'format');
10554
+ allowOnlyValues(format, ['spki', 'pkcs8', 'raw'], 'format');
10556
10555
  checkType(getBuffer(keyData), ArrayBuffer, { name: 'keyData' });
10557
10556
  if (typeof algorithm === 'string') {
10558
10557
  allowOnlyValues(algorithm, ['AES-GCM', 'HKDF'], 'algorithm');
@@ -10657,7 +10656,7 @@ class SubtleCrypto {
10657
10656
  if (arguments.length !== 2) {
10658
10657
  throw new TypeError(`Expected 2 arguments, got ${arguments.length}`);
10659
10658
  }
10660
- allowOnlyValues(format, ['raw', 'spki', 'teeKeyHandle'], 'format');
10659
+ allowOnlyValues(format, ['raw', 'spki'], 'format');
10661
10660
  checkType(key, CryptoKey, { name: 'key' });
10662
10661
  return new Promise$1((onSuccess, onReject) => this._nativeObject.subtleExportKey(format, key, onSuccess, onReject));
10663
10662
  });
@@ -10673,21 +10672,17 @@ class SubtleCrypto {
10673
10672
  checkType(extractable, Boolean, { name: 'extractable' });
10674
10673
  checkType(keyUsages, Array, { name: 'keyUsages' });
10675
10674
  if (options != null) {
10676
- allowOnlyKeys(options, ['inTee', 'usageRequiresAuth']);
10677
- if ('inTee' in options) {
10678
- checkType(options.inTee, Boolean, { name: 'options.inTee' });
10679
- }
10675
+ allowOnlyKeys(options, ['usageRequiresAuth']);
10680
10676
  if ('usageRequiresAuth' in options) {
10681
10677
  checkType(options.usageRequiresAuth, Boolean, { name: 'options.usageRequiresAuth' });
10682
10678
  }
10683
- if (options.usageRequiresAuth && !options.inTee && tabris.device.platform !== 'Android') {
10684
- throw new TypeError('options.usageRequiresAuth is only supported for keys not in TEE on Android');
10679
+ if (options.usageRequiresAuth && (extractable || !algorithm.name.startsWith('EC'))) {
10680
+ throw new TypeError('options.usageRequiresAuth is only supported for non-extractable EC keys');
10685
10681
  }
10686
10682
  }
10687
- const inTee = options === null || options === void 0 ? void 0 : options.inTee;
10688
10683
  const usageRequiresAuth = options === null || options === void 0 ? void 0 : options.usageRequiresAuth;
10689
10684
  const nativeObject = new _CryptoKey();
10690
- yield nativeObject.generate(algorithm, extractable, keyUsages, inTee, usageRequiresAuth);
10685
+ yield nativeObject.generate(algorithm, extractable, keyUsages, usageRequiresAuth);
10691
10686
  const nativePrivate = new _CryptoKey(nativeObject, 'private');
10692
10687
  const nativePublic = new _CryptoKey(nativeObject, 'public');
10693
10688
  return {