コード例 #1
0
        /// <summary>
        /// Load state from an XML element
        /// </summary>
        /// <param name="xmlElement">XML element containing new state</param>
        /// <param name="counterSignedXmlElement">Element containing parent signature (needed if there are counter signatures)</param>
        public void LoadXml(System.Xml.XmlElement xmlElement, XmlElement counterSignedXmlElement)
        {
            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:UnsignedSignatureProperties", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.unsignedSignatureProperties = new UnsignedSignatureProperties();
                this.unsignedSignatureProperties.LoadXml((XmlElement)xmlNodeList.Item(0), counterSignedXmlElement);
            }

            xmlNodeList = xmlElement.SelectNodes("xsd:UnsignedDataObjectProperties", xmlNamespaceManager);
            if (xmlNodeList.Count != 0)
            {
                this.unsignedDataObjectProperties = new UnsignedDataObjectProperties();
                this.unsignedDataObjectProperties.LoadXml((XmlElement)xmlNodeList.Item(0));
            }
        }
コード例 #2
0
 /// <summary>
 /// Default constructor
 /// </summary>
 public UnsignedProperties()
 {
     this.UnsignedSignatureProperties  = new UnsignedSignatureProperties();
     this.unsignedDataObjectProperties = new UnsignedDataObjectProperties();
 }