Merge pull request #1580 from akoeplinger/msbuild-3B-escape
[mono.git] / mcs / class / System.Security / System.Security.Cryptography.Xml / Signature.cs
index 9aab99f8386dad23a9ae12970b96106f1a352a36..49e9d3ad9913e176b17bafb62e3bfdd244dbc0df 100644 (file)
@@ -3,8 +3,10 @@
 //
 // Author:
 //     Sebastien Pouliot (spouliot@motus.com)
+//      Tim Coleman (tim@timcoleman.com)
 //
 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
+// Copyright (C) Tim Coleman, 2004
 //
 
 //
@@ -98,6 +100,11 @@ namespace System.Security.Cryptography.Xml {
                }
 
                public XmlElement GetXml () 
+               {
+                       return GetXml (null);
+               }
+
+               internal XmlElement GetXml (XmlDocument document)
                {
                        if (element != null)
                                return element;
@@ -107,7 +114,9 @@ namespace System.Security.Cryptography.Xml {
                        if (signature == null)
                                throw new CryptographicException ("SignatureValue");
 
-                       XmlDocument document = new XmlDocument ();
+                       if (document == null)
+                               document = new XmlDocument ();
+
                        XmlElement xel = document.CreateElement (XmlSignature.ElementNames.Signature, XmlSignature.NamespaceURI);
                        if (id != null)
                                xel.SetAttribute (XmlSignature.AttributeNames.Id, id);
@@ -209,4 +218,4 @@ namespace System.Security.Cryptography.Xml {
                        return -1;
                }
        }
-}
\ No newline at end of file
+}