fromCbor
Convert CBOR to credential.
Deserializes CBOR-encoded bytes back to a VerifiableCredential. The CBOR bytes are first converted to JSON format, then parsed using kotlinx.serialization.
Implementation Details:
Uses Jackson CBOR mapper to parse CBOR bytes to JSON tree model
Converts JSON tree to JSON string
Uses kotlinx.serialization to deserialize JSON string to VerifiableCredential
Handles all credential structures including nested objects and arrays
Error Handling:
Throws IllegalArgumentException if CBOR bytes are invalid
Throws SerializationException if credential structure is invalid
Recommended: Use the extension function cborBytes.fromCbor() instead for a more elegant API.
Return
Verifiable credential
Parameters
CBOR-encoded bytes
See also
Throws
if CBOR bytes cannot be parsed
if credential deserialization fails