requestPassphrase

suspend fun PromptModel.requestPassphrase(title: String, subtitle: String, passphraseConstraints: PassphraseConstraints, passphraseEvaluator: suspend (enteredPassphrase: String) -> PassphraseEvaluation?): 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 PassphraseEvaluation.OK to indicate the passphrase is correct otherwise PassphraseEvaluation.TryAgain with optional number of remaining attempts, or PassphraseEvaluation.TooManyAttempts should be returned.

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.