requestPassphrase

suspend fun requestPassphrase(title: String, subtitle: String, passphraseConstraints: PassphraseConstraints, passphraseEvaluator: suspend (enteredPassphrase: String) -> String??): String?

Requests that the UI layer should ask the user for a passphrase.

If passphraseEvaluator is not null, it is called every time the user inputs a passphrase with the passphrase that was entered. It should return null to indicate the passphrase is correct otherwise a short message which is displayed in prompt indicating the user entered the wrong passphrase and optionally how many attempts are remaining.

To dismiss the prompt programmatically, cancel the job the coroutine was launched in.

Return

the passphrase entered by the user.

Parameters

title

the title for the passphrase prompt.

subtitle

the subtitle for the passphrase prompt.

passphraseConstraints

the PassphraseConstraints for the passphrase.

passphraseEvaluator

an optional function to evaluate the passphrase and give the user feedback.

Throws

if user dismissed passphrase prompt dialog.

if the UI layer hasn't bound any UI for PromptModel.