Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,27 @@ rnBiometrics.createSignature({
})
```

__Node.js example of server-side signature verification__

```js
const crypto = require('crypto');

async function veryfySignature(publicKey, signature, payload) {
const cryptoKey = await crypto.subtle.importKey('spki',
Buffer.from(publicKey, 'base64'),
{ name: 'RSASSA-PKCS1-v1_5', hash: "SHA-256" },
true, ['verify']
);

const verify = crypto.createVerify('SHA256');
verify.write(payload);
verify.end();

return verify.verify(crypto.KeyObject.from(cryptoKey), signature, 'base64')
}

```

### simplePrompt(options)

Prompts the user for their fingerprint or face id. Returns a `Promise` that resolves if the user provides a valid biometrics or cancel the prompt, otherwise the promise rejects.
Expand Down