/// <summary> /// Load state from an XML element /// </summary> /// <param name="xmlElement">XML element containing new state</param> public void LoadXml(System.Xml.XmlElement xmlElement) { XmlNamespaceManager xmlNamespaceManager; XmlNodeList xmlNodeList; if (xmlElement == null) { throw new ArgumentNullException("xmlElement"); } xmlNamespaceManager = new XmlNamespaceManager(xmlElement.OwnerDocument.NameTable); xmlNamespaceManager.AddNamespace("ds", SignedXml.XmlDsigNamespaceUrl); xmlNamespaceManager.AddNamespace("xsd", XadesSignedXml.XadesNamespaceUri); xmlNodeList = xmlElement.SelectNodes("xsd:CertDigest", xmlNamespaceManager); if (xmlNodeList.Count == 0) { throw new CryptographicException("CertDigest missing"); } this.certDigest = new DigestAlgAndValueType("CertDigest"); this.certDigest.LoadXml((XmlElement)xmlNodeList.Item(0)); xmlNodeList = xmlElement.SelectNodes("xsd:IssuerSerial", xmlNamespaceManager); if (xmlNodeList.Count == 0) { throw new CryptographicException("IssuerSerial missing"); } this.issuerSerial = new IssuerSerial(); this.issuerSerial.LoadXml((XmlElement)xmlNodeList.Item(0)); }
/// <summary> /// Default constructor /// </summary> public Cert() { this.certDigest = new DigestAlgAndValueType("CertDigest"); this.issuerSerial = new IssuerSerial(); }