Conversation
Add createKeys, biometricKeysExist, deleteKeys and createSignature methods to generate a biometric-protected RSA key pair in secure hardware (iOS Secure Enclave / Android Keystore) and sign payloads with it. - extend the TurboModule spec and JS wrapper - implement key generation/signing on Android and iOS - link the Security framework in the podspec - document the new API and demo it in the example app
- bump react-native, react and @react-native/* packages to 0.86.2 - upgrade @react-native-community/cli to 20.1.0 and builder-bob to 0.43 - update gradle wrapper to 9.3.1 and raise network timeout - add nkf to Gemfile and refresh Podfile/pod lockfile - switch jest preset to @react-native/jest-preset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds on-device biometric key generation and signing to the library. The private key is generated in secure hardware (iOS Secure Enclave / Android Keystore) and can only be used after the user passes biometric authentication.
New API
BiometricKey = { keyName, publicKey (base64), algorithm }Signature = { keyName, publicKey, signature (base64) }Design notes
keyName, default"default") so multiple keys can coexist — the main future-proofing decision.algorithm,publicKey) can be added later without breaking changes.requestBioAuth.Changes
src/NativeSimpleBiometrics.ts: extend TurboModule spec (codegen propagates to both platforms).src/index.tsx: JS wrappers with defaults + payload validation.android/.../SimpleBiometricsModule.kt:KeyStore+KeyGenParameterSpec;BiometricPrompt.CryptoObjectfor signing.ios/SimpleBiometrics.mm:SecKeyCreateRandomKey,SecItemCopyMatching/SecItemDelete,SecKeyCreateSignature.SimpleBiometrics.podspec: linkSecurityframework.Tests
yarn typecheck,yarn lint,yarn test(7 passing) — all green.@react-native/codegento confirm the generated native spec matches the Kotlin/ObjC implementations.See
docs/key-generation.mdfor the full implementation plan.closes #14