2004-07-07 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Wed, 7 Jul 2004 19:15:19 +0000 (19:15 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Wed, 7 Jul 2004 19:15:19 +0000 (19:15 -0000)
* X509Certificate.cs: Fixed NET_2_0 directives.
* X509ContentType.cs: New enum in Fx 2.0.
* X509KeyStorageFlags.cs: New flags in Fx 2.0.

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

mcs/class/corlib/System.Security.Cryptography.X509Certificates/ChangeLog
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509Certificate.cs
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs [new file with mode: 0644]
mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs [new file with mode: 0644]

index b5a036af4235ef15ea25bd3bc5101e20eea480f4..45937e7e23bcdf6f6a84beb5fef1ca3e5ff45d93 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-07  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * X509Certificate.cs: Fixed NET_2_0 directives.
+       * X509ContentType.cs: New enum in Fx 2.0.
+       * X509KeyStorageFlags.cs: New flags in Fx 2.0.
+
 2003-12-15  Sebastien Pouliot  <spouliot@videotron.ca>
 
        * X509Certificate.cs: Removed old (commented) Authenticode stuff.
 2003-12-15  Sebastien Pouliot  <spouliot@videotron.ca>
 
        * X509Certificate.cs: Removed old (commented) Authenticode stuff.
index af5722f601d0274de91e575e5e0d468b0386472a..1c47348a5a084475d05cb1c23f685c929bd5598d 100644 (file)
@@ -2,12 +2,9 @@
 // X509Certificates.cs: Handles X.509 certificates.
 //
 // Author:
 // X509Certificates.cs: Handles X.509 certificates.
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
 //
 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
-//
-
-//
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
@@ -40,7 +37,7 @@ using Mono.Security;
 using Mono.Security.Authenticode;
 using Mono.Security.X509;
 
 using Mono.Security.Authenticode;
 using Mono.Security.X509;
 
-#if !(NET_1_0 || NET_1_1)
+#if NET_2_0
 using System.Runtime.Serialization;
 #endif
 
 using System.Runtime.Serialization;
 #endif
 
@@ -53,11 +50,11 @@ namespace System.Security.Cryptography.X509Certificates {
        // LAMESPEC: the MSDN docs always talks about X509v3 certificates
        // and/or Authenticode certs. However this class works with older
        // X509v1 certificates and non-authenticode (code signing) certs.
        // LAMESPEC: the MSDN docs always talks about X509v3 certificates
        // and/or Authenticode certs. However this class works with older
        // X509v1 certificates and non-authenticode (code signing) certs.
-#if (NET_1_0 || NET_1_1)
+#if NET_2_0
+       public class X509Certificate : IDeserializationCallback, ISerializable {
+#else
        [Serializable]
        public class X509Certificate {
        [Serializable]
        public class X509Certificate {
-#else
-       public class X509Certificate : IDeserializationCallback, ISerializable {
 #endif
                // typedef struct _CERT_CONTEXT {
                 //     DWORD                   dwCertEncodingType;
 #endif
                // typedef struct _CERT_CONTEXT {
                 //     DWORD                   dwCertEncodingType;
@@ -159,7 +156,7 @@ namespace System.Security.Cryptography.X509Certificates {
                        }
                }
 
                        }
                }
 
-#if !(NET_1_0 || NET_1_1)
+#if NET_2_0
                public X509Certificate () {}
 
                public X509Certificate (byte[] rawData, string password) {}
                public X509Certificate () {}
 
                public X509Certificate (byte[] rawData, string password) {}
@@ -378,7 +375,7 @@ namespace System.Security.Cryptography.X509Certificates {
                                return base.ToString ();
                }
 
                                return base.ToString ();
                }
 
-#if !(NET_1_0 || NET_1_1)
+#if NET_2_0
                public virtual byte[] Export (X509ContentType contentType)
                {
                        return null;
                public virtual byte[] Export (X509ContentType contentType)
                {
                        return null;
@@ -410,4 +407,4 @@ namespace System.Security.Cryptography.X509Certificates {
                }
 #endif
        }
                }
 #endif
        }
-}
\ No newline at end of file
+}
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509ContentType.cs
new file mode 100644 (file)
index 0000000..c83c6ab
--- /dev/null
@@ -0,0 +1,47 @@
+//
+// System.Security.Cryptography.X509Certificates.X509ContentType.cs
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+namespace System.Security.Cryptography.X509Certificates {
+
+// Note: Definitions are useful for 1.0 Untitled 1and 1.1 so we declare them internal
+
+#if NET_2_0
+       public
+#else
+       internal
+#endif
+       enum X509ContentType {
+               Unknown,
+               Cert,
+               SerializedCert,
+               Pfx,
+               SerializedStore,
+               Pkcs7,
+               Authenticode
+       }
+}
diff --git a/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs b/mcs/class/corlib/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs
new file mode 100644 (file)
index 0000000..3d87390
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// System.Security.Cryptography.X509Certificates.X509KeyStorageFlags.cs
+//
+// Author:
+//     Sebastien Pouliot  <sebastien@ximian.com>
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+using System;
+
+namespace System.Security.Cryptography.X509Certificates {
+
+       [Flags]
+       public enum X509KeyStorageFlags {
+               DefaultKeySet,
+               UserKeySet,
+               MachineKeySet,
+               Exportable,
+               UserProtected,
+               PersistKeySet 
+       }
+}
+
+#endif