createMdocCredentialWithSampleData
suspend fun createMdocCredentialWithSampleData(document: Document, secureArea: SecureArea, createKeySettings: CreateKeySettings, dsKey: AsymmetricKey.X509Certified, signedAt: Instant, validFrom: Instant, validUntil: Instant, expectedUpdate: Instant? = null, domain: String = "mdoc", randomProvider: Random = Crypto.secureRandom, includeElement: (namespaceName: String, dataElement: MdocDataElement) -> Boolean = { _, _ -> true }, deviceKeyAuthorizedNamespaces: List<String> = emptyList(), deviceKeyAuthorizedDataElements: Map<String, List<String>> = emptyMap()): MdocCredential
Adds a MdocCredential to a Document with sample data for the document type.
Return
the MdocCredential that was added to document.
Parameters
document
the Document to add the credential to.
secureArea
the SecureArea to use for DeviceKey.
createKeySettings
the CreateKeySettings to use.
dsKey
the key to sign the MSO with and its certificate chain.
signedAt
the time the MSO was signed.
validFrom
the time at which the credential is valid from.
validUntil
the time at which the credential is valid until.
expectedUpdate
the time at which to expect an update, or null.
domain
the domain to use for the credential.
randomProvider
random number generator to use.
includeElement
predicate to filter which elements are included.
deviceKeyAuthorizedNamespaces
namespaces the device key is authorized to sign.
deviceKeyAuthorizedDataElements
data elements the device key is authorized to sign, keyed by namespace.