Header.deserialize constructor

Header.deserialize(
  1. CborListValue cbor
)

Implementation

factory Header.deserialize(CborListValue cbor) {
  if (cbor.value.length == 1) {
    return Header(
        headerBody: HeaderBody.deserialize(cbor.getIndex(0)),
        signature: KESSignature.deserialize(
            cbor.getIndex<CborListValue>(0).getIndex(14)));
  }
  return Header(
      headerBody: HeaderBody.deserialize(cbor.getIndex(0)),
      signature: KESSignature.deserialize(cbor.getIndex(1)));
}