Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 8.49 KB

File metadata and controls

53 lines (39 loc) · 8.49 KB

//document-manager/eu.europa.ec.eudi.wallet.document/DocumentManager/Builder

Builder

class Builder(context: Context)

Builder class to instantiate the default DocumentManager implementation.

example:

val documentManager = DocumentManager.Builder(context)
   .useEncryption(true)
   .storageDir(context.noBackupFilesDir)
   .enableUserAuth(true)
   .userAuthTimeout(30000)
   .build()

Parameters

androidJvm

context Context used to instantiate the DocumentManager

Constructors

Builder [androidJvm]
constructor(context: Context)

Functions

Name Summary
build [androidJvm]
fun build(): DocumentManager
Build the DocumentManager
checkPublicKeyBeforeAdding [androidJvm]
fun checkPublicKeyBeforeAdding(checkPublicKeyBeforeAdding: Boolean): DocumentManager.Builder
Sets whether to check public key in MSO before adding document to storage. By default, this is set to true. This check is done to prevent adding documents with public key that is not in MSO. The public key from the UnsignedDocument must match the public key in MSO.
enableUserAuth [androidJvm]
fun enableUserAuth(enable: Boolean): DocumentManager.Builder
Sets whether to require user authentication to access the document.
storageDir [androidJvm]
fun storageDir(storageDir: File): DocumentManager.Builder
The directory to store data files in. By default, the Context.getNoBackupFilesDir is used.
useEncryption [androidJvm]
fun useEncryption(useEncryption: Boolean): DocumentManager.Builder
Sets whether to encrypt the values stored on disk. Note that keys are not encrypted, only values. By default, this is set to true.
userAuthTimeout [androidJvm]
fun userAuthTimeout(timeoutInMillis: Long): DocumentManager.Builder
Sets the timeout in milliseconds for user authentication.

Properties

Name Summary
checkPublicKeyBeforeAdding [androidJvm]
var checkPublicKeyBeforeAdding: Boolean
flag that indicates if the public key from the UnsignedDocument must match the public key in MSO. By default this is set to true.
storageDir [androidJvm]
var storageDir: File
the directory to store data files in. By default the Context.getNoBackupFilesDir is used.
useEncryption [androidJvm]
var useEncryption: Boolean
whether to encrypt the values stored on disk. Note that keys are not encrypted, only values. By default this is set to true.
userAuth [androidJvm]
var userAuth: Boolean
flag that indicates if the document requires user authentication to be accessed. By default this is set to true if the device is secured with a PIN, password or pattern.
userAuthTimeoutInMillis [androidJvm]
var userAuthTimeoutInMillis: Long
timeout in milliseconds for user authentication. By default this is set to 30 seconds.