private void BuildDigestedReferences() { // Default the DigestMethod and Canonicalization ArrayList references = SignedInfo.References; // Reset the cache m_refProcessed = new bool[references.Count]; m_refLevelCache = new int[references.Count]; ReferenceLevelSortOrder sortOrder = new ReferenceLevelSortOrder(); sortOrder.References = references; sortOrder.SignedXml = this; // Don't alter the order of the references array list ArrayList sortedReferences = new ArrayList(); foreach (Reference reference in references) { sortedReferences.Add(reference); } sortedReferences.Sort(sortOrder); CanonicalXmlNodeList nodeList = new CanonicalXmlNodeList(); foreach (DataObject obj in m_signature.ObjectList) { nodeList.Add(obj.GetXml()); } foreach (Reference reference in sortedReferences) { // If no DigestMethod has yet been set, default it to sha1 if (reference.DigestMethod == null) { reference.DigestMethod = XmlDsigSHA1Url; } // propagate namespaces reference.Namespaces = m_namespaces; reference.SignedXml = this; reference.UpdateHashValue(m_containingDocument, nodeList); // If this reference has an Id attribute, add it if (reference.Id != null) { nodeList.Add(reference.GetXml()); } } }
private void BuildDigestedReferences() { // Default the DigestMethod and Canonicalization ArrayList references = SignedInfo.References; // Reset the cache _refProcessed = new bool [references.Count]; _refLevelCache = new int [references.Count]; ReferenceLevelSortOrder sortOrder = new ReferenceLevelSortOrder(); sortOrder.References = references; // Don't alter the order of the references array list ArrayList sortedReferences = new ArrayList(); foreach (Reference reference in references) { sortedReferences.Add(reference); } sortedReferences.Sort(sortOrder); CanonicalXmlNodeList nodeList = new CanonicalXmlNodeList(); foreach (DataObject obj in m_signature.ObjectList) { nodeList.Add(obj.GetXml()); } foreach (Reference reference in sortedReferences) { if (reference.DigestMethod == null) { reference.DigestMethod = XmlDsigDigestDefault; } SignedXmlDebugLog.LogSigningReference(this, reference); reference.UpdateHashValue(_containingDocument, nodeList); // If this reference has an Id attribute, add it if (reference.Id != null) { nodeList.Add(reference.GetXml()); } } }
private void BuildDigestedReferences() { ArrayList references = this.SignedInfo.References; this.m_refProcessed = new bool[references.Count]; this.m_refLevelCache = new int[references.Count]; ReferenceLevelSortOrder comparer = new ReferenceLevelSortOrder { References = references }; ArrayList list2 = new ArrayList(); foreach (Reference reference in references) { list2.Add(reference); } list2.Sort(comparer); CanonicalXmlNodeList refList = new CanonicalXmlNodeList(); foreach (DataObject obj2 in this.m_signature.ObjectList) { refList.Add(obj2.GetXml()); } foreach (Reference reference2 in list2) { if (reference2.DigestMethod == null) { reference2.DigestMethod = "http://www.w3.org/2000/09/xmldsig#sha1"; } SignedXmlDebugLog.LogSigningReference(this, reference2); reference2.UpdateHashValue(this.m_containingDocument, refList); if (reference2.Id != null) { refList.Add(reference2.GetXml()); } } }
private void BuildDigestedReferences() { ArrayList references = this.SignedInfo.References; this.m_refProcessed = new bool[references.Count]; this.m_refLevelCache = new int[references.Count]; ReferenceLevelSortOrder comparer = new ReferenceLevelSortOrder { References = references }; ArrayList list2 = new ArrayList(); foreach (Reference reference in references) { list2.Add(reference); } list2.Sort(comparer); CanonicalXmlNodeList refList = new CanonicalXmlNodeList(); foreach (DataObject obj2 in this.m_signature.ObjectList) { refList.Add(obj2.GetXml()); } foreach (Reference reference2 in list2) { if (reference2.DigestMethod == null) { reference2.DigestMethod = "http://www.w3.org/2000/09/xmldsig#sha1"; } SignedXmlDebugLog.LogSigningReference(this, reference2); reference2.UpdateHashValue(this.m_containingDocument, refList); if (reference2.Id != null) { refList.Add(reference2.GetXml()); } } }
private void BuildDigestedReferences() { // Default the DigestMethod and Canonicalization ArrayList references = SignedInfo.References; // Reset the cache m_refProcessed = new bool[references.Count]; m_refLevelCache = new int[references.Count]; ReferenceLevelSortOrder sortOrder = new ReferenceLevelSortOrder(); sortOrder.References = references; // Don't alter the order of the references array list ArrayList sortedReferences = new ArrayList(); foreach (Reference reference in references) { sortedReferences.Add(reference); } sortedReferences.Sort(sortOrder); CanonicalXmlNodeList nodeList = new CanonicalXmlNodeList(); foreach (DataObject obj in m_signature.ObjectList) { nodeList.Add(obj.GetXml()); } foreach (Reference reference in sortedReferences) { // If no DigestMethod has yet been set, default it to sha1 if (reference.DigestMethod == null) reference.DigestMethod = XmlDsigSHA1Url; SignedXmlDebugLog.LogSigningReference(this, reference); reference.UpdateHashValue(m_containingDocument, nodeList); // If this reference has an Id attribute, add it if (reference.Id != null) nodeList.Add(reference.GetXml()); } }