From 061de33b2764a016a688b5cec8723fa569152c64 Mon Sep 17 00:00:00 2001 From: Charles Schaefer Date: Mon, 24 Feb 2025 19:13:23 -0300 Subject: [PATCH] Adding doc changes in readme.md --- plugins/biometric/README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/plugins/biometric/README.md b/plugins/biometric/README.md index c7844f7b..684b143d 100644 --- a/plugins/biometric/README.md +++ b/plugins/biometric/README.md @@ -1,6 +1,6 @@ ![biometric](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/biometric/banner.png) -Prompt the user for biometric authentication on Android and iOS. +Prompt the user for biometric authentication on Android and iOS. Also allows to use assymetric key protected | Platform | Supported | | -------- | --------- | @@ -8,7 +8,7 @@ Prompt the user for biometric authentication on Android and iOS. | Windows | x | | macOS | x | | Android | ✓ | -| iOS | ✓ | +| iOS | ✓ (except biometric cryptography ) | ## Install @@ -70,8 +70,27 @@ fn main() { Afterwards all the plugin's APIs are available through the JavaScript guest bindings: ```javascript -import { authenticate } from '@tauri-apps/plugin-biometric' -await authenticate('Open your wallet') +import { checkStatus, authenticate, biometricCipher } from '@tauri-apps/plugin-biometric' + +const status = await checkStatus(); +if (status.isAvailble) { + await authenticate('Open your wallet') +} + +// ... or using biometric-protected cryptography: +if (status.isAvailable) { + const encryptOptions = { + dataToEncrypt: getData(), + }; + const encrypted = await biometricCipher('Login without typing password', encryptOptions); + + const decryptOptions = { + dataToDecrypt: encrypted.data, + }; + const originalData = await biometricCipher('Login without typing password', decryptOptions); +} + + ``` ## Contributing