fromDataItem
suspend fun fromDataItem(dataItem: DataItem, disableSignatureVerification: Boolean = false): MpzPass
Parses a CBOR array DataItem into an MpzPass.
If the pass contains a signed container (#6.18(COSE_Sign1)), the signature is checked against the leaf certificate in the X.509 certificate chain (unless disableSignatureVerification is true). Note that this method only verifies the cryptographic signature; it is the caller's responsibility to examine issuerCertificateChain and check whether it originates from a trusted pass provider.
Return
The parsed MpzPass.
Parameters
dataItem
The top-level CBOR array containing the MpzPass string tag and (signed or unsigned) compressed bytes.
disableSignatureVerification
Set to true to skip cryptographic signature verification.
Throws
if CBOR decoding or decompression fails, or if signature headers are malformed.
if signature verification fails.