DocumentStore

Class for storing real-world identity documents.

This class is designed for storing real-world identity documents such as Mobile Driving Licenses (mDL) as specified in ISO/IEC 18013-5:2021. It is however not tied to that specific document format and is designed to hold any kind of document, regardless of format, presentation-, or issuance-protocol used.

This code relies on a Secure Area for keys and this dependency is abstracted by the SecureArea interface and allows the use of different SecureArea implementations for Authentication Keys) associated with documents stored in the Document Store.

It is guaranteed that once a document is created with createDocument, each subsequent call to lookupDocument will return the same Document instance.

For more details about documents stored in a DocumentStore see the Document class.

Use buildDocumentStore or DocumentStore.Builder to create a DocumentStore instance.

Types

Link copied to clipboard
class Builder(storage: Storage, secureAreaRepository: SecureAreaRepository)

A builder for DocumentStore.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val eventFlow: SharedFlow<DocumentEvent>

A SharedFlow which can be used to listen for when credentials are added and removed from the store as well as when credentials in the store have been updated.

Link copied to clipboard

the repository of configured SecureArea that can be used.

Link copied to clipboard

the Storage to use for storing/retrieving documents.

Functions

Link copied to clipboard
suspend fun createDocument(metadataInitializer: suspend (metadata: AbstractDocumentMetadata) -> Unit = {}): Document

Creates a new document using another AbstractDocumentMetadata than DocumentMetadata.

suspend fun createDocument(displayName: String? = null, typeDisplayName: String? = null, cardArt: ByteString? = null, issuerLogo: ByteString? = null, other: ByteString? = null): Document

Creates a new document.

Link copied to clipboard
suspend fun deleteDocument(identifier: String)

Deletes a document.

Link copied to clipboard
suspend fun listDocuments(): List<String>

Lists all documents in the store.

Link copied to clipboard
suspend fun lookupDocument(identifier: String): Document?

Looks up a document in the store.