2006-09-20 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 20 Sep 2006 16:35:24 +0000 (16:35 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 20 Sep 2006 16:35:24 +0000 (16:35 -0000)
* SignedXml.cs : handle KeyInfoX509Data in GetPublicKey(). Fixed #1 of
  bug #79454.

svn path=/trunk/mcs/; revision=65727

mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog
mcs/class/System.Security/System.Security.Cryptography.Xml/SignedXml.cs

index 8c811d144d357940ecbb80bcd2490b0e8e7a15cd..66f417a6deec29a1ce8ab58855f2bdf3a381111a 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-20  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * SignedXml.cs : handle KeyInfoX509Data in GetPublicKey(). Fixed #1 of
+         bug #79454.
+
 2006-09-07  Atsushi Enomoto  <atsushi@ximian.com>
 
        * EncryptedXml.cs : DecryptData() should not pass block size to
index ef8f18954896e445adb2c0f12e61ffdb86ee9b12..50718164a586ff2042f0aac8821cb35d6e1a72ef 100644 (file)
@@ -685,6 +685,13 @@ namespace System.Security.Cryptography.Xml {
                                AsymmetricAlgorithm key = null;
                                KeyInfoClause kic = (KeyInfoClause) pkEnumerator.Current;
 
+#if NET_2_0
+                               if (kic is KeyInfoX509Data) {
+                                       foreach (X509Certificate cert in ((KeyInfoX509Data) kic).Certificates)
+                                               // FIXME: this GetRawCertData() should not be required, but it somehow causes crash.
+                                               return new X509Certificate2 (cert.GetRawCertData ()).PublicKey.Key;
+                               }
+#endif
                                if (kic is DSAKeyValue)
                                        key = DSA.Create ();
                                else if (kic is RSAKeyValue)