createBatch

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

Creates a batch of KeyBoundSdJwtVcCredential 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, which is more efficient than creating keys individually, especially for hardware-backed secure areas where multiple cryptographic operations can be expensive.

All credentials in the batch will share the same domain and credential type (vct), but will have unique keys and identifiers.

Return

A pair containing:

  • A list of created KeyBoundSdJwtVcCredential 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.

vct

The Verifiable Credential Type for all credentials in the batch.

createKeySettings

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