Ejemplo n.º 1
0
        /// <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");
            }
            if (xmlElement.HasAttribute("Id"))
            {
                this.id = xmlElement.GetAttribute("Id");
            }
            else
            {
                this.id = "";
            }

            xmlNamespaceManager = new XmlNamespaceManager(xmlElement.OwnerDocument.NameTable);
            xmlNamespaceManager.AddNamespace("xsd", XadesSignedXml.XadesNamespaceUri);

            xmlNodeList = xmlElement.SelectNodes("xsd:CRLValues", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.crlValues = new CRLValues();
                this.crlValues.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
            xmlNodeList = xmlElement.SelectNodes("xsd:OCSPValues", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.ocspValues = new OCSPValues();
                this.ocspValues.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
            xmlNodeList = xmlElement.SelectNodes("xsd:OtherValues", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.otherValues = new OtherValues();
                this.otherValues.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public RevocationValues()
 {
     this.crlValues   = new CRLValues();
     this.ocspValues  = new OCSPValues();
     this.otherValues = new OtherValues();
 }