COSESigStructure.deserialize constructor

COSESigStructure.deserialize(
  1. CborIterableObject<Iterable> cbor
)

Implementation

factory COSESigStructure.deserialize(CborIterableObject cbor) {
  int index = 0;
  return COSESigStructure(
      context: COSESigContext.fromValue(cbor.elementAtString(index++)),
      bodyProtected: COSEProtectedHeaderMap.deserialize(
          cbor.elementAt<CborBytesValue>(index++)),
      signProtected: cbor.value.length == 4
          ? null
          : COSEProtectedHeaderMap.deserialize(
              cbor.elementAt<CborBytesValue>(index++)),
      externalAAD: cbor.elementAtBytes(index++),
      payload: cbor.elementAtBytes(index++),
      serializationConfig: COSESerializationConfig(encoding: cbor.encoding));
}