|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
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'
|
|
|
|
|
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
|
|
|
|
|