PlatformParameter.fromXML constructor

PlatformParameter.fromXML(
  1. String xmlSTR
)

Implementation

factory PlatformParameter.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);

  String platformVendor = document.rootElement.attributes
      .firstWhere((p0) => p0.name.toString() == "platformVendor")
      .value;
  String platformVersion = document.rootElement.attributes
      .firstWhere((p0) => p0.name.toString() == "platformVersion")
      .value;

  XmlElement? cryptAlgorithmInfoElement =
      document.firstChild!.getElement("cryptAlgorithmInfo");

  CryptAlgorithmInfo cryptAlgorithmInfo =
      CryptAlgorithmInfo.fromXML(cryptAlgorithmInfoElement!.toString());

  return PlatformParameter(
      platformVendor: platformVendor,
      platformVersion: platformVersion,
      cryptAlgorithmInfo: cryptAlgorithmInfo);
}