📄 DocumentStore
Before you can create or manage real-world identity documents, you need to set up repositories and storage for document types and documents. This should be done after initializing your secure storage components.
DocumentTypeRepository
A DocumentTypeRepository
manages the metadata for different document types your app understands and uses.
- Standard Document Types: Multipaz provides a set of standard document types through the
multipaz-knowntypes
package, such as:DrivingLicense
EUCertificateOfResidence
PhotoID
VaccinationDocument
VehicleRegistration
- Custom Document Types: You can define your own document types using the
DocumentType.Builder
factory method.
DocumentStore
A DocumentStore
is responsible for securely holding and managing real-world identity documents, such as Mobile Driving Licenses (mDL), in accordance with the ISO/IEC 18013-5:2021 specification.
- Initialization: Create a
DocumentStore
instance using either thebuildDocumentStore
function or theDocumentStore.Builder
class. - Dependencies: Pass the previously-initialized
storage
andsecureAreaRepository
to theDocumentStore
.
Implementation
class App {
// ...
lateinit var documentTypeRepository: DocumentTypeRepository
lateinit var documentStore: DocumentStore
suspend fun init() {
// ...
documentTypeRepository = DocumentTypeRepository().apply {
addDocumentType(DrivingLicense.getDocumentType())
}
documentStore = buildDocumentStore(
storage = storage,
secureAreaRepository = secureAreaRepository
) {}
}
}
By clearly structuring the setup of DocumentTypeRepository
and DocumentStore
, you ensure your app is ready to manage identity documents securely and efficiently. Always perform this setup early in your app lifecycle, after initializing storage and secure areas.
Refer to this part for the implementation of the DocumentStore section of this guide.