openwallet-foundation-labs / identity-credential

Apache License 2.0
149 stars 76 forks source link

Add support for passphrases. #572

Closed davidz25 closed 2 months ago

davidz25 commented 2 months ago

Intodouce PassphraseConstraints class which can be used to specify details about a passphrase, for example whether all characters are numerical and the min/max length. This is helpful when e.g. the passphrase is always a six-digit PIN because it allows the application to present an UI/UX optimized towards that. Add support for this in SoftwareSecureArea.

Introduce applyConfiguration() method on builders for classes derived from CreateKeystoreSettings to allow the issuer to specify configuration of how to create a key.

Add a requireUserAuthenticationToViewDocument setting to DocumentConfiguration so the issuer can specify if they want the user to authenticate in order to view document data. Enforce it in the wallet app. For now just require LSKF/biometric authentication, in the future we can use other methods as well.

Add new evidence type for having the user create a passphrase/PIN, using PassphraseConstraints.

In the wallet app, rename some types to properly reflect the reality of the recent Credential->Document and AuthenticationKey->Credential rename. When in developer mode, add a number of extra screens to the provisioning of an mDL including which Secure Area to use (Android Keystore or Software), whether to use StrongBox (if using Android Keystore), the passphrase/PIN (if using Software), and mdoc authentication mode and curve.

Other minor fixes/changes

Test: Manually tested and all unit tests pass.

Fixes #

It's a good idea to open an issue first for discussion.