fromData static method

X509Certificate fromData({
  1. required Uint8List data,
})

Implementation

static X509Certificate fromData({required Uint8List data}) {
  var decoded = utf8.decode(data, allowMalformed: true);
  if (decoded.contains(X509Certificate.beginPemBlock)) {
    return X509Certificate.fromPemData(pem: data);
  } else {
    return X509Certificate.fromDerData(der: data);
  }
}