createDocument

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

Creates a new document.

The parameters passed will be available in the Document.metadata property of the returned document and can be updated using AbstractDocumentMetadata.setMetadata and AbstractDocumentMetadata.markAsProvisioned.

The initial provisioning state of the document will be false. This can be updated using AbstractDocumentMetadata.markAsProvisioned when configured with one or more certified Credential instances.

If a document with the given identifier already exists, it will be deleted prior to creating the document.

Parameters

displayName

User-facing name of this specific Document instance, e.g. "John's Passport", or null.

typeDisplayName

User-facing name of this document type, e.g. "Utopia Passport", or null.

cardArt

An image that represents this document to the user in the UI. Generally, the aspect ratio of 1.586 is expected (based on ID-1 from the ISO/IEC 7810). PNG format is expected and transparency is supported.

issuerLogo

An image that represents the issuer of the document in the UI, e.g. passport office logo. PNG format is expected, transparency is supported and square aspect ratio is preferred.

other

Additional data the application wishes to store.


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

Creates a new document using another AbstractDocumentMetadata than DocumentMetadata.

If a document with the given identifier already exists, it will be deleted prior to creating the document.

Return

A newly created document.

Parameters

metadataInitializer

a function to create an instance implementing AbstractDocumentMetadata.