CertificateType.deserialize constructor

CertificateType.deserialize(
  1. CborIntValue cbor, {
  2. CertificateType? validate,
})

Constructs a CertificateType from a serialized value.

Implementation

factory CertificateType.deserialize(CborIntValue cbor,
    {CertificateType? validate}) {
  final type = fromValue(cbor.value);
  if (validate != null && type != validate) {
    throw MessageException("Invalid Certificate type.",
        details: {"Excepted": validate, "Type": type});
  }
  return type;
}