toDataItem
suspend fun toDataItem(signingKey: AsymmetricKey? = null, issuerCertificateChain: X509CertChain? = null, compressionLevel: Int = 5): DataItem
Serializes and compresses this MpzPass into a DataItem.
If signingKey and issuerCertificateChain are provided, the compressed credential data payload is signed using COSE_Sign1 according to RFC 9052 and wrapped as #6.18(COSE_Sign1).
Return
A DataItem.
Parameters
signingKey
Optional key used to sign the pass.
issuerCertificateChain
Optional X.509 certificate chain for the pass issuer.
compressionLevel
The DEFLATE compression level to use (0-9). Defaults to 5.
Throws
if only one of signingKey or issuerCertificateChain is provided, or if the compression level is out of range.