createBatch

suspend fun createBatch(numberOfCredentials: Int, document: Document, domain: String, secureArea: SecureArea, docType: String, createKeySettings: CreateKeySettings): Pair<List<MdocCredential>, String?>

Creates a batch of MdocCredential instances with keys created in a single batch operation.

This method optimizes the key creation process by using the secure area's batch key creation functionality. This can be significantly more efficient than creating keys individually, especially for hardware-backed secure areas where multiple key operations might be expensive.

Return

A pair containing:

  • A list of created MdocCredential instances, ready to be certified

  • An optional string containing the compact serialization of a JWS with OpenID4VCI key attestation data if supported by the secure area.

Parameters

numberOfCredentials

The number of credentials to create in the batch.

document

The document to add the credentials to.

domain

The domain for all credentials in the batch.

secureArea

The secure area to use for creating keys.

docType

The docType for all credentials in the batch.

createKeySettings

The settings to use for key creation, including algorithm parameters.