Browse Source

2004-06-17 Sebastien Pouliot <[email protected]>

	* KeyInfoX509Data.cs: Removed old internal IssuerSerial for the
	undocumented structure (now documented, and public, in Fx 2.0).
	* X509IssuerSerial.cs: Use structure as public in NET_2_0 and as
	internal before that.

svn path=/trunk/mcs/; revision=29817
Sebastien Pouliot 21 years ago
parent
commit
e858743eaf

+ 7 - 0
mcs/class/System.Security/System.Security.Cryptography.Xml/ChangeLog

@@ -1,3 +1,10 @@
+2004-06-17  Sebastien Pouliot  <[email protected]>
+
+	* KeyInfoX509Data.cs: Removed old internal IssuerSerial for the 
+	undocumented structure (now documented, and public, in Fx 2.0).
+	* X509IssuerSerial.cs: Use structure as public in NET_2_0 and as 
+	internal before that.
+
 2004-06-10  Gert Driesen <[email protected]>
 
 	* SignedXml.cs: API signature fixes

+ 8 - 22
mcs/class/System.Security/System.Security.Cryptography.Xml/KeyInfoX509Data.cs

@@ -1,8 +1,8 @@
 //
 // KeyInfoX509Data.cs - KeyInfoX509Data implementation for XML Signature
 //
-// Author:
-//	Sebastien Pouliot ([email protected])
+// Authors:
+//	Sebastien Pouliot  <[email protected]>
 //	Atsushi Enomoto ([email protected])
 //
 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
@@ -15,21 +15,7 @@ using System.Xml;
 
 namespace System.Security.Cryptography.Xml {
 
-	// FIXME: framework class isn't documented so compatibility isn't assured!
-	internal class IssuerSerial
-	{
-		public string Issuer;
-		public string Serial;
-
-		public IssuerSerial (string issuer, string serial) 
-		{
-			Issuer = issuer;
-			Serial = serial;
-		}
-	}
-
-	public class KeyInfoX509Data : KeyInfoClause 
-	{
+	public class KeyInfoX509Data : KeyInfoClause {
 
 		private byte[] x509crl;
 		private ArrayList IssuerSerialList;
@@ -83,8 +69,8 @@ namespace System.Security.Cryptography.Xml {
 
 		public void AddIssuerSerial (string issuerName, string serialNumber) 
 		{
-			IssuerSerial isser = new IssuerSerial (issuerName, serialNumber);
-			IssuerSerialList.Add (isser);
+			X509IssuerSerial xis = new X509IssuerSerial (issuerName, serialNumber);
+			IssuerSerialList.Add (xis);
 		}
 
 		public void AddSubjectKeyId (byte[] subjectKeyId) 
@@ -110,13 +96,13 @@ namespace System.Security.Cryptography.Xml {
 			xel.SetAttribute ("xmlns", XmlSignature.NamespaceURI);
 			// <X509IssuerSerial>
 			if (IssuerSerialList.Count > 0) {
-				foreach (IssuerSerial iser in IssuerSerialList) {
+				foreach (X509IssuerSerial iser in IssuerSerialList) {
 					XmlElement isl = document.CreateElement (XmlSignature.ElementNames.X509IssuerSerial, XmlSignature.NamespaceURI);
 					XmlElement xin = document.CreateElement (XmlSignature.ElementNames.X509IssuerName, XmlSignature.NamespaceURI);
-					xin.InnerText = iser.Issuer;
+					xin.InnerText = iser.IssuerName;
 					isl.AppendChild (xin);
  					XmlElement xsn = document.CreateElement (XmlSignature.ElementNames.X509SerialNumber, XmlSignature.NamespaceURI);
-					xsn.InnerText = iser.Serial;
+					xsn.InnerText = iser.SerialNumber;
 					isl.AppendChild (xsn);
 					xel.AppendChild (isl);
 				}

+ 17 - 4
mcs/class/System.Security/System.Security.Cryptography.Xml/X509IssuerSerial.cs

@@ -3,16 +3,29 @@
 //
 // Author:
 //      Tim Coleman ([email protected])
+//	Sebastien Pouliot  <[email protected]>
 //
 // Copyright (C) Tim Coleman, 2004
-
-#if NET_2_0
+// Copyright (C) 2004 Novell Inc. (http://www.novell.com)
+//
 
 namespace System.Security.Cryptography.Xml {
-	public struct X509IssuerSerial {
+
+#if NET_2_0
+	public
+#else
+	// structure was undocumented (but present) before Fx 2.0
+	internal
+#endif
+	struct X509IssuerSerial {
 		public string IssuerName;
 		public string SerialNumber;
+
+		public X509IssuerSerial (string issuer, string serial) 
+		{
+			IssuerName = issuer;
+			SerialNumber = serial;
+		}
 	}
 }
 
-#endif