createKeys method
Future
createKeys({
- required String reason,
- dynamic showIOSErrorDialog = true,
- DialogMessages dialogMessages = const DialogMessages(),
Creates SHA256 RSA key pair for signing using biometrics
Will create a new keypair each time method is called
Returns Base-64 encoded public key as a String if successful
reason
is the message to show when user will be prompted to authenticate using biometrics
showIOSErrorDialog
is used on iOS side to decide if error dialog should be displayed
Provide dialogMessages
if you want to customize messages for the auth dialog
Implementation
Future<dynamic> createKeys({
required String reason,
showIOSErrorDialog = true,
DialogMessages dialogMessages = const DialogMessages(),
}) async {
assert(reason != null);
final Map<String, Object> args = <String, Object>{
'reason': reason,
'useErrorDialogs': showIOSErrorDialog,
};
args.addAll(dialogMessages.messages);
return await _channel.invokeMethod<dynamic>(MethodNames.createKeys, args);
}