fromDataItem

Creates a ZkDocumentData instance from a CBOR DataItem.

This factory method deserializes a CBOR representation back into a ZkDocumentData object. It validates and extracts all required fields from the CBOR map structure.

Expected CBOR structure:

  • "id": Required text string for the ZK system specification ID

  • "docType": Required text string for the document type

  • "timestamp": Required text string in ISO-8601 format

  • "issuerSignedItems": Optional array of DataItems (defaults to empty list)

  • "deviceSignedItems": Optional array of DataItems (defaults to empty list)

  • "msoX5chain": Required X.509 certificate chain

Return

A new ZkDocumentData instance

Parameters

dataItem

The CBOR DataItem to deserialize

Throws

if required fields are missing or have invalid types