@tokamakdev/plugin-secure-storage 0.1.0-beta.116 → 0.1.0-beta.118

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.
Files changed (2) hide show
  1. package/android/Bindings.kt +26 -26
  2. package/package.json +2 -2
@@ -43,7 +43,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
43
43
  "KeyStore.TrustedCertificateEntry" -> callKeyStore_TrustedCertificateEntry(method, b)
44
44
  "Cipher" -> callCipher(method, b)
45
45
  "KeyGenerator" -> callKeyGenerator(method, b)
46
- else -> b.unsupported(method)
46
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
47
47
  }
48
48
  }
49
49
 
@@ -59,14 +59,14 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
59
59
  "BackendBusyException#<init>(J)V" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(android.security.keystore.BackendBusyException(b.long(b[0]))) }
60
60
  "BackendBusyException#<init>(JLjava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(android.security.keystore.BackendBusyException(b.long(b[0]), b.string(b[1]))) }
61
61
  "BackendBusyException#getBackOffHintMillis()J" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.BackendBusyException::class.java).getBackOffHintMillis()) }
62
- else -> b.unsupported(method)
62
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
63
63
  }
64
64
 
65
65
  private fun callKeyExpiredException(method: String, b: TokamakBinding): (() -> Unit)? =
66
66
  when (method) {
67
67
  "KeyExpiredException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.KeyExpiredException()) }
68
68
  "KeyExpiredException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.KeyExpiredException(b.optional(b[0]) { x1 -> b.string(x1) })) }
69
- else -> b.unsupported(method)
69
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
70
70
  }
71
71
 
72
72
  private fun callKeyGenParameterSpec(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -95,7 +95,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
95
95
  "KeyGenParameterSpec#getAttestKeyAlias()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyGenParameterSpec::class.java).getAttestKeyAlias()) }
96
96
  "KeyGenParameterSpec#getMgf1Digests()Ljava/util/Set;" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyGenParameterSpec::class.java).getMgf1Digests()) }
97
97
  "KeyGenParameterSpec#isMgf1DigestsSpecified()Z" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyGenParameterSpec::class.java).isMgf1DigestsSpecified()) }
98
- else -> b.unsupported(method)
98
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
99
99
  }
100
100
 
101
101
  private fun callKeyGenParameterSpec_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -122,7 +122,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
122
122
  "KeyGenParameterSpec.Builder#setMaxUsageCount(I)Landroid/security/keystore/KeyGenParameterSpec\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyGenParameterSpec.Builder::class.java).setMaxUsageCount(b.int(b[0]))) }
123
123
  "KeyGenParameterSpec.Builder#setAttestKeyAlias(Ljava/lang/String;)Landroid/security/keystore/KeyGenParameterSpec\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyGenParameterSpec.Builder::class.java).setAttestKeyAlias(b.optional(b[0]) { x1 -> b.string(x1) })) }
124
124
  "KeyGenParameterSpec.Builder#setMgf1Digests([Ljava/lang/String;)Landroid/security/keystore/KeyGenParameterSpec\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyGenParameterSpec.Builder::class.java).setMgf1Digests(*b.list(b[0]) { x1 -> b.string(x1) }.toTypedArray())) }
125
- else -> b.unsupported(method)
125
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
126
126
  }
127
127
 
128
128
  private fun callKeyInfo(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -146,21 +146,21 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
146
146
  "KeyInfo#getUserAuthenticationType()I" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyInfo::class.java).getUserAuthenticationType()) }
147
147
  "KeyInfo#getSecurityLevel()I" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyInfo::class.java).getSecurityLevel()) }
148
148
  "KeyInfo#getRemainingUsageCount()I" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyInfo::class.java).getRemainingUsageCount()) }
149
- else -> b.unsupported(method)
149
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
150
150
  }
151
151
 
152
152
  private fun callKeyNotYetValidException(method: String, b: TokamakBinding): (() -> Unit)? =
153
153
  when (method) {
154
154
  "KeyNotYetValidException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.KeyNotYetValidException()) }
155
155
  "KeyNotYetValidException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.KeyNotYetValidException(b.optional(b[0]) { x1 -> b.string(x1) })) }
156
- else -> b.unsupported(method)
156
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
157
157
  }
158
158
 
159
159
  private fun callKeyPermanentlyInvalidatedException(method: String, b: TokamakBinding): (() -> Unit)? =
160
160
  when (method) {
161
161
  "KeyPermanentlyInvalidatedException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.KeyPermanentlyInvalidatedException()) }
162
162
  "KeyPermanentlyInvalidatedException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.KeyPermanentlyInvalidatedException(b.optional(b[0]) { x1 -> b.string(x1) })) }
163
- else -> b.unsupported(method)
163
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
164
164
  }
165
165
 
166
166
  private fun callKeyProtection(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -183,7 +183,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
183
183
  "KeyProtection#getMaxUsageCount()I" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyProtection::class.java).getMaxUsageCount()) }
184
184
  "KeyProtection#getMgf1Digests()Ljava/util/Set;" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyProtection::class.java).getMgf1Digests()) }
185
185
  "KeyProtection#isMgf1DigestsSpecified()Z" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyProtection::class.java).isMgf1DigestsSpecified()) }
186
- else -> b.unsupported(method)
186
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
187
187
  }
188
188
 
189
189
  private fun callKeyProtection_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -206,35 +206,35 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
206
206
  "KeyProtection.Builder#setIsStrongBoxBacked(Z)Landroid/security/keystore/KeyProtection\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyProtection.Builder::class.java).setIsStrongBoxBacked(b.boolean(b[0]))) }
207
207
  "KeyProtection.Builder#setMaxUsageCount(I)Landroid/security/keystore/KeyProtection\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyProtection.Builder::class.java).setMaxUsageCount(b.int(b[0]))) }
208
208
  "KeyProtection.Builder#setMgf1Digests([Ljava/lang/String;)Landroid/security/keystore/KeyProtection\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.KeyProtection.Builder::class.java).setMgf1Digests(*b.list(b[0]) { x1 -> b.optional(x1) { x2 -> b.string(x2) } }.toTypedArray())) }
209
- else -> b.unsupported(method)
209
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
210
210
  }
211
211
 
212
212
  private fun callSecureKeyImportUnavailableException(method: String, b: TokamakBinding): (() -> Unit)? =
213
213
  when (method) {
214
214
  "SecureKeyImportUnavailableException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(android.security.keystore.SecureKeyImportUnavailableException()) }
215
215
  "SecureKeyImportUnavailableException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(android.security.keystore.SecureKeyImportUnavailableException(b.optional(b[0]) { x1 -> b.string(x1) })) }
216
- else -> b.unsupported(method)
216
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
217
217
  }
218
218
 
219
219
  private fun callStrongBoxUnavailableException(method: String, b: TokamakBinding): (() -> Unit)? =
220
220
  when (method) {
221
221
  "StrongBoxUnavailableException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(android.security.keystore.StrongBoxUnavailableException()) }
222
222
  "StrongBoxUnavailableException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(android.security.keystore.StrongBoxUnavailableException(b.optional(b[0]) { x1 -> b.string(x1) })) }
223
- else -> b.unsupported(method)
223
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
224
224
  }
225
225
 
226
226
  private fun callUserNotAuthenticatedException(method: String, b: TokamakBinding): (() -> Unit)? =
227
227
  when (method) {
228
228
  "UserNotAuthenticatedException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.UserNotAuthenticatedException()) }
229
229
  "UserNotAuthenticatedException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 23) throw TokamakBinding.unavailable; b.encode(android.security.keystore.UserNotAuthenticatedException(b.optional(b[0]) { x1 -> b.string(x1) })) }
230
- else -> b.unsupported(method)
230
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
231
231
  }
232
232
 
233
233
  private fun callUserPresenceUnavailableException(method: String, b: TokamakBinding): (() -> Unit)? =
234
234
  when (method) {
235
235
  "UserPresenceUnavailableException#<init>()V" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(android.security.keystore.UserPresenceUnavailableException()) }
236
236
  "UserPresenceUnavailableException#<init>(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(android.security.keystore.UserPresenceUnavailableException(b.optional(b[0]) { x1 -> b.string(x1) })) }
237
- else -> b.unsupported(method)
237
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
238
238
  }
239
239
 
240
240
  private fun callWrappedKeyEntry(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -242,7 +242,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
242
242
  "WrappedKeyEntry#getWrappedKeyBytes()[B" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.WrappedKeyEntry::class.java).getWrappedKeyBytes()) }
243
243
  "WrappedKeyEntry#getWrappingKeyAlias()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.WrappedKeyEntry::class.java).getWrappingKeyAlias()) }
244
244
  "WrappedKeyEntry#getTransformation()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 28) throw TokamakBinding.unavailable; b.encode(b.target(android.security.keystore.WrappedKeyEntry::class.java).getTransformation()) }
245
- else -> b.unsupported(method)
245
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
246
246
  }
247
247
 
248
248
  private fun callKeyStore(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -260,7 +260,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
260
260
  "KeyStore#load(Ljava/security/KeyStore\$LoadStoreParameter;)V" -> b.run { b.target(java.security.KeyStore::class.java).load(b.optional(b[0]) { x1 -> b.obj(x1, java.security.KeyStore.LoadStoreParameter::class.java) }); null }
261
261
  "KeyStore#getEntry(Ljava/lang/String;Ljava/security/KeyStore\$ProtectionParameter;)Ljava/security/KeyStore\$Entry;" -> b.run { b.encode(b.target(java.security.KeyStore::class.java).getEntry(b.optional(b[0]) { x1 -> b.string(x1) }, b.optional(b[1]) { x1 -> b.obj(x1, java.security.KeyStore.ProtectionParameter::class.java) })) }
262
262
  "KeyStore#setEntry(Ljava/lang/String;Ljava/security/KeyStore\$Entry;Ljava/security/KeyStore\$ProtectionParameter;)V" -> b.run { b.target(java.security.KeyStore::class.java).setEntry(b.optional(b[0]) { x1 -> b.string(x1) }, b.optional(b[1]) { x1 -> b.obj(x1, java.security.KeyStore.Entry::class.java) }, b.optional(b[2]) { x1 -> b.obj(x1, java.security.KeyStore.ProtectionParameter::class.java) }); null }
263
- else -> b.unsupported(method)
263
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
264
264
  }
265
265
 
266
266
  private fun callKeyStore_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -268,26 +268,26 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
268
268
  "KeyStore.Builder#getKeyStore()Ljava/security/KeyStore;" -> b.run { b.encode(b.target(java.security.KeyStore.Builder::class.java).getKeyStore()) }
269
269
  "KeyStore.Builder#getProtectionParameter(Ljava/lang/String;)Ljava/security/KeyStore\$ProtectionParameter;" -> b.run { b.encode(b.target(java.security.KeyStore.Builder::class.java).getProtectionParameter(b.optional(b[0]) { x1 -> b.string(x1) })) }
270
270
  "KeyStore.Builder#newInstance(Ljava/security/KeyStore;Ljava/security/KeyStore\$ProtectionParameter;)Ljava/security/KeyStore\$Builder;" -> b.run { b.encode(java.security.KeyStore.Builder.newInstance(b.optional(b[0]) { x1 -> b.obj(x1, java.security.KeyStore::class.java) }, b.optional(b[1]) { x1 -> b.obj(x1, java.security.KeyStore.ProtectionParameter::class.java) })) }
271
- else -> b.unsupported(method)
271
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
272
272
  }
273
273
 
274
274
  private fun callKeyStore_Entry(method: String, b: TokamakBinding): (() -> Unit)? =
275
275
  when (method) {
276
276
  "KeyStore.Entry#getAttributes()Ljava/util/Set;" -> b.run { if (Build.VERSION.SDK_INT < 26) throw TokamakBinding.unavailable; b.encode(b.target(java.security.KeyStore.Entry::class.java).getAttributes()) }
277
- else -> b.unsupported(method)
277
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
278
278
  }
279
279
 
280
280
  private fun callKeyStore_Entry_Attribute(method: String, b: TokamakBinding): (() -> Unit)? =
281
281
  when (method) {
282
282
  "KeyStore.Entry.Attribute#getName()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 26) throw TokamakBinding.unavailable; b.encode(b.target(java.security.KeyStore.Entry.Attribute::class.java).getName()) }
283
283
  "KeyStore.Entry.Attribute#getValue()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 26) throw TokamakBinding.unavailable; b.encode(b.target(java.security.KeyStore.Entry.Attribute::class.java).getValue()) }
284
- else -> b.unsupported(method)
284
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
285
285
  }
286
286
 
287
287
  private fun callKeyStore_LoadStoreParameter(method: String, b: TokamakBinding): (() -> Unit)? =
288
288
  when (method) {
289
289
  "KeyStore.LoadStoreParameter#getProtectionParameter()Ljava/security/KeyStore\$ProtectionParameter;" -> b.run { b.encode(b.target(java.security.KeyStore.LoadStoreParameter::class.java).getProtectionParameter()) }
290
- else -> b.unsupported(method)
290
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
291
291
  }
292
292
 
293
293
  private fun callKeyStore_PasswordProtection(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -297,28 +297,28 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
297
297
  "KeyStore.PasswordProtection#destroy()V" -> b.run { b.target(java.security.KeyStore.PasswordProtection::class.java).destroy(); null }
298
298
  "KeyStore.PasswordProtection#isDestroyed()Z" -> b.run { b.encode(b.target(java.security.KeyStore.PasswordProtection::class.java).isDestroyed()) }
299
299
  "KeyStore.PasswordProtection#getProtectionAlgorithm()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 26) throw TokamakBinding.unavailable; b.encode(b.target(java.security.KeyStore.PasswordProtection::class.java).getProtectionAlgorithm()) }
300
- else -> b.unsupported(method)
300
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
301
301
  }
302
302
 
303
303
  private fun callKeyStore_PrivateKeyEntry(method: String, b: TokamakBinding): (() -> Unit)? =
304
304
  when (method) {
305
305
  "KeyStore.PrivateKeyEntry#getAttributes()Ljava/util/Set;" -> b.run { b.encode(b.target(java.security.KeyStore.PrivateKeyEntry::class.java).getAttributes()) }
306
306
  "KeyStore.PrivateKeyEntry#toString()Ljava/lang/String;" -> b.run { b.encode(b.target(java.security.KeyStore.PrivateKeyEntry::class.java).toString()) }
307
- else -> b.unsupported(method)
307
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
308
308
  }
309
309
 
310
310
  private fun callKeyStore_SecretKeyEntry(method: String, b: TokamakBinding): (() -> Unit)? =
311
311
  when (method) {
312
312
  "KeyStore.SecretKeyEntry#getAttributes()Ljava/util/Set;" -> b.run { b.encode(b.target(java.security.KeyStore.SecretKeyEntry::class.java).getAttributes()) }
313
313
  "KeyStore.SecretKeyEntry#toString()Ljava/lang/String;" -> b.run { b.encode(b.target(java.security.KeyStore.SecretKeyEntry::class.java).toString()) }
314
- else -> b.unsupported(method)
314
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
315
315
  }
316
316
 
317
317
  private fun callKeyStore_TrustedCertificateEntry(method: String, b: TokamakBinding): (() -> Unit)? =
318
318
  when (method) {
319
319
  "KeyStore.TrustedCertificateEntry#getAttributes()Ljava/util/Set;" -> b.run { b.encode(b.target(java.security.KeyStore.TrustedCertificateEntry::class.java).getAttributes()) }
320
320
  "KeyStore.TrustedCertificateEntry#toString()Ljava/lang/String;" -> b.run { b.encode(b.target(java.security.KeyStore.TrustedCertificateEntry::class.java).toString()) }
321
- else -> b.unsupported(method)
321
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
322
322
  }
323
323
 
324
324
  private fun callCipher(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -342,7 +342,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
342
342
  "Cipher#getMaxAllowedKeyLength(Ljava/lang/String;)I" -> b.run { b.encode(javax.crypto.Cipher.getMaxAllowedKeyLength(b.optional(b[0]) { x1 -> b.string(x1) })) }
343
343
  "Cipher#updateAAD([B)V" -> b.run { if (Build.VERSION.SDK_INT < 19) throw TokamakBinding.unavailable; b.target(javax.crypto.Cipher::class.java).updateAAD(b.optional(b[0]) { x1 -> b.bytes(x1) }); null }
344
344
  "Cipher#updateAAD([BII)V" -> b.run { if (Build.VERSION.SDK_INT < 19) throw TokamakBinding.unavailable; b.target(javax.crypto.Cipher::class.java).updateAAD(b.optional(b[0]) { x1 -> b.bytes(x1) }, b.int(b[1]), b.int(b[2])); null }
345
- else -> b.unsupported(method)
345
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
346
346
  }
347
347
 
348
348
  private fun callKeyGenerator(method: String, b: TokamakBinding): (() -> Unit)? =
@@ -351,6 +351,6 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
351
351
  "KeyGenerator#getInstance(Ljava/lang/String;)Ljavax/crypto/KeyGenerator;" -> b.run { b.encode(javax.crypto.KeyGenerator.getInstance(b.optional(b[0]) { x1 -> b.string(x1) })) }
352
352
  "KeyGenerator#getInstance(Ljava/lang/String;Ljava/lang/String;)Ljavax/crypto/KeyGenerator;" -> b.run { b.encode(javax.crypto.KeyGenerator.getInstance(b.optional(b[0]) { x1 -> b.string(x1) }, b.optional(b[1]) { x1 -> b.string(x1) })) }
353
353
  "KeyGenerator#init(I)V" -> b.run { b.target(javax.crypto.KeyGenerator::class.java).init(b.int(b[0])); null }
354
- else -> b.unsupported(method)
354
+ else -> throw TokamakPluginError.notSupported("$method is not supported")
355
355
  }
356
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokamakdev/plugin-secure-storage",
3
- "version": "0.1.0-beta.116",
3
+ "version": "0.1.0-beta.118",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/mantty/tokamak.git",
@@ -12,7 +12,7 @@
12
12
  "./android": "./android/bindings.ts"
13
13
  },
14
14
  "peerDependencies": {
15
- "@tokamakdev/plugin": "0.1.0-beta.116"
15
+ "@tokamakdev/plugin": "0.1.0-beta.118"
16
16
  },
17
17
  "files": [
18
18
  "android",