Changeset 2542


Ignore:
Timestamp:
Jan 31, 2011, 7:09:57 PM (11 years ago)
Author:
Tim Podeszwa
Message:

code reworked

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/WebService/Canonicalizator.cs

    r639 r2542  
    1212   public class Canonicalizator
    1313   {
     14       #region Fields
     15
    1416       private Transform transform;
    1517       private XmlDocument inputString;
     18
     19       #endregion
     20
     21       #region Constructor
     22
    1623       public Canonicalizator(XmlDocument inputString)
    1724       {
     
    2027       }
    2128
    22        public Stream canonicalizeNode(XmlElement nodeToCanon)
     29       #endregion
     30
     31       #region Methods
     32
     33       public Stream CanonicalizeNode(XmlElement nodeToCanon)
    2334       {
    24 
    2535           XmlNode node = (XmlNode)nodeToCanon;
    26        
    27      
    2836           XmlNodeReader reader = new XmlNodeReader(node);
    2937           Stream stream = new MemoryStream();
    30 
    3138           XmlWriter writer = new XmlTextWriter(stream, Encoding.UTF8);
    32 
    3339           writer.WriteNode(reader, false);
    3440           writer.Flush();
    35          
    3641           stream.Position = 0;
     42           XmlDsigExcC14NTransform transform = new XmlDsigExcC14NTransform();
     43           transform.LoadInput(stream);
     44           return transform.GetOutput() as Stream;
     45       }
    3746
    38            stream.Position = 0;
    39            //Transform anwenden
    40            XmlDsigExcC14NTransform trans = new XmlDsigExcC14NTransform();
    41            trans.LoadInput(stream);
    42        
    43            Stream stream2 = (Stream)trans.GetOutput();
    44            //StreamReader sreader = new StreamReader(stream2);
    45            //string canonString = sreader.ReadToEnd();
    46            //stream2.Position = 0;
    47            return stream2;
    48        
    49        }
    50      
    51  
    52     }
     47       #endregion
     48   }
    5349}
Note: See TracChangeset for help on using the changeset viewer.