CryptAlgorithmInfo.fromXML constructor

CryptAlgorithmInfo.fromXML(
  1. String xmlSTR
)

Implementation

factory CryptAlgorithmInfo.fromXML(String xmlSTR) {
  final document = XmlDocument.parse(xmlSTR);
  XmlElement defaultCryptAlgorithmElement =
      document.rootElement.findAllElements("defaultCryptAlgorithm").first;
  XmlElement cryptAlgorithmListElement =
      document.rootElement.findAllElements("availableCryptAlgorithms").first;
  XmlElement defaultCrypt =
      defaultCryptAlgorithmElement.findElements("cryptAlgorithm").first;
  List<XmlElement> cryptos =
      cryptAlgorithmListElement.findElements("cryptAlgorithm").toList();
  CryptAlgorithm defaultCryptAlgorithm =
      CryptAlgorithm.fromXML(defaultCrypt.toXmlString());
  List<CryptAlgorithm> cryptAlgorithmList =
      cryptos.map((e) => CryptAlgorithm.fromXML(e.toXmlString())).toList();

  return CryptAlgorithmInfo(
      defaultCryptAlgorithm: defaultCryptAlgorithm,
      availableCryptAlgorithms: cryptAlgorithmList);
}