2004-07-08 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 9 Jul 2004 02:06:25 +0000 (02:06 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 9 Jul 2004 02:06:25 +0000 (02:06 -0000)
* OpenFlags.cs: Fixed flags values. Added missing attributes.
* StoreLocation.cs: Fixed enum values. Added missing [Serializable].
* StoreName.cs: Fixed enum values. Added missing [Serializable].
* X500DistinguishedName.cs: New. X.501 DN.
* X500DistinguishedNameFlags.cs: New. X.501 DN flags.
* X509CertificateEx.cs: Updated to Fx 2.0 beta 1. Added MonoTODO.
* X509Chain.cs: Added missing Reset method.
* X509ChainStatusFlags.cs: Fixed flags values. Added missing attrs.
* X509Extension.cs: Fixed API.
* X509ExtensionCollection.cs: Fixed API and implemented.
* X509FindType.cs: Fixed enum values. Added missing [Serializable].
* X509IncludeOption.cs: Added missing [Serializable].
* X509KeyUsageFlags.cs: : Fixed flags values. Added missing attrs.
* X509NameType.cs: Fixed enum values. Added missing [Serializable].
* X509RevocationFlag.cs: Fixed enum values. Added missing [Serializable].
* X509RevocationMode.cs: Added missing [Serializable].
* X509SelectionFlag.cs: Added missing [Serializable].
* X509VerificationFlags.cs: Fixed flags values. Added missing attrs.

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

19 files changed:
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/ChangeLog
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/OpenFlags.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/StoreLocation.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/StoreName.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs [new file with mode: 0644]
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs [new file with mode: 0644]
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509CertificateEx.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509Chain.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509Extension.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509ExtensionCollection.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509FindType.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509IncludeOption.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509KeyUsageFlags.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509NameType.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509RevocationMode.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509SelectionFlag.cs
mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs

index 3fa11af9c9b4a2f49b96efba33e9675f96f03a00..2cb9c21f39f919bf07871d1aa1e52ac5902c786f 100755 (executable)
@@ -1,3 +1,24 @@
+2004-07-08  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * OpenFlags.cs: Fixed flags values. Added missing attributes.
+       * StoreLocation.cs: Fixed enum values. Added missing [Serializable].
+       * StoreName.cs: Fixed enum values. Added missing [Serializable].
+       * X500DistinguishedName.cs: New. X.501 DN.
+       * X500DistinguishedNameFlags.cs: New. X.501 DN flags.
+       * X509CertificateEx.cs: Updated to Fx 2.0 beta 1. Added MonoTODO.
+       * X509Chain.cs: Added missing Reset method.
+       * X509ChainStatusFlags.cs: Fixed flags values. Added missing attrs.
+       * X509Extension.cs: Fixed API.
+       * X509ExtensionCollection.cs: Fixed API and implemented.
+       * X509FindType.cs: Fixed enum values. Added missing [Serializable].
+       * X509IncludeOption.cs: Added missing [Serializable].
+       * X509KeyUsageFlags.cs: : Fixed flags values. Added missing attrs.
+       * X509NameType.cs: Fixed enum values. Added missing [Serializable].
+       * X509RevocationFlag.cs: Fixed enum values. Added missing [Serializable].
+       * X509RevocationMode.cs: Added missing [Serializable].
+       * X509SelectionFlag.cs: Added missing [Serializable].
+       * X509VerificationFlags.cs: Fixed flags values. Added missing attrs.
+
 2004-07-07  Sebastien Pouliot  <sebastien@ximian.com>
 
        * X509Store.cs: Removed old store code (as it has changed a lot in 
index 8e2e81cd2c9369ffffe75acb5a1efb3d518534fe..56793279aad55e25da11dbee00c0db2d8bd8a5e0 100755 (executable)
@@ -2,11 +2,10 @@
 // OpenFlags.cs - System.Security.Cryptography.X509Certificates.OpenFlags
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,15 +33,15 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Flags]
+       [Serializable]
        public enum OpenFlags {
                ReadOnly,
                ReadWrite, 
                MaxAllowed,
-               OpenExistingOnly,
-               IncludeArchived
+               OpenExistingOnly = 4,
+               IncludeArchived = 8
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index e815cc37513042632f93012096cfd80bd88fa93a..565ba11caefbc77064cbd6447c1b530057e466e4 100755 (executable)
@@ -2,11 +2,10 @@
 // StoreLocation.cs - System.Security.Cryptography.X509Certificates.StoreLocation
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,12 +33,11 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum StoreLocation {
-               CurrentUser,
-               LocalMachine
+               CurrentUser = 1,
+               LocalMachine = 2
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 688164219af443cf5ff4615401e486d0ddb40f13..6e621ff3ea900664386a0d4cd7150cfbf6fece59 100755 (executable)
@@ -2,11 +2,10 @@
 // StoreName.cs - System.Security.Cryptography.X509Certificates.StoreName
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,18 +33,17 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum StoreName {
-               AddressBook,
-               AuthRoot,
-               CertificateAuthority,
-               Disallowed,
-               My,
-               Root,
-               TrustedPeople,
-               TrustedPublisher 
+               AddressBook = 1,
+               AuthRoot = 2,
+               CertificateAuthority = 3,
+               Disallowed = 4,
+               My = 5,
+               Root = 6,
+               TrustedPeople = 7,
+               TrustedPublisher = 8 
        }
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs b/mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs
new file mode 100644 (file)
index 0000000..d72e47f
--- /dev/null
@@ -0,0 +1,85 @@
+//
+// System.Security.Cryptography.X509Certificates.X500DistinguishedName
+//
+// 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;
+using System.Text;
+
+using MX = Mono.Security.X509;
+
+namespace System.Security.Cryptography.X509Certificates {
+
+       public sealed class X500DistinguishedName : AsnEncodedData {
+
+               [MonoTODO]
+               public X500DistinguishedName (AsnEncodedData encodedDistinguishedName)
+               {
+               }
+
+               [MonoTODO]
+               public X500DistinguishedName (byte[] encodedDistinguishedName)
+               {
+               }
+
+               [MonoTODO]
+               public X500DistinguishedName (string distinguishedName)
+               {
+               }
+
+               [MonoTODO]
+               public X500DistinguishedName (string distinguishedName, X500DistinguishedNameFlags flag)
+               {
+               }
+
+               [MonoTODO]
+               public X500DistinguishedName (X500DistinguishedName distinguishedName)
+               {
+               }
+
+               [MonoTODO]
+               public string Name {
+                       get { return null; }
+               }
+
+               [MonoTODO]
+               public string Decode (X500DistinguishedNameFlags flag)
+               {
+                       return null;
+               }
+
+               [MonoTODO]
+               public override string Format (bool multiLine)
+               {
+                       return null;
+               }
+
+       }
+}
+
+#endif
diff --git a/mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs b/mcs/class/System.Security/System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs
new file mode 100644 (file)
index 0000000..2b994e3
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// System.Security.Cryptography.X509Certificates.X500DistinguishedNameFlags
+//
+// 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]
+       [Serializable]
+       public enum X500DistinguishedNameFlags {
+               None = 0,
+               Reversed = 1,
+               UseSemicolons = 16,
+               DoNotUsePlusSign = 32,
+               DoNotUseQuotes = 64,
+               UseCommas = 128,
+               UseNewLines = 256,
+               UseUTF8Encoding = 4096,
+               UseT61Encoding = 8192
+       }
+}
+
+#endif
index d8ad29a313135b7e114f9e08a5fe07019cdf8f58..2958dadf8c33839f8cf2b850b67a039354650839 100755 (executable)
@@ -2,11 +2,10 @@
 // X509CertificateEx.cs - System.Security.Cryptography.X509CertificateEx
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -37,9 +36,7 @@ using MX = Mono.Security.X509;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
-       public sealed class X509CertificateEx : X509Certificate {
+       public class X509CertificateEx : X509Certificate {
 
                private bool _archived;
                private X509ExtensionCollection _extensions;
@@ -114,8 +111,9 @@ namespace System.Security.Cryptography.X509Certificates {
                        set { _name = value; }
                }
 
-               public string Issuer {
-                       get { return _cert.IssuerName; }
+               [MonoTODO]
+               public X500DistinguishedName IssuerName {
+                       get { return null; }
                } 
 
                public DateTime NotAfter {
@@ -162,8 +160,9 @@ namespace System.Security.Cryptography.X509Certificates {
                        get { return null; }
                } 
 
-               public string Subject {
-                       get { return _cert.SubjectName; }
+               [MonoTODO]
+               public X500DistinguishedName SubjectName {
+                       get { return null; }
                } 
 
                public string Thumbprint {
@@ -176,10 +175,17 @@ namespace System.Security.Cryptography.X509Certificates {
 
                // methods
 
-               public void Display () {}
+               [MonoTODO]
+               public void Display ()
+               {
+               }
 
-               public void Display (IntPtr hwndParent) {}
+               [MonoTODO]
+               public void Display (IntPtr hwndParent) 
+               {
+               }
 
+               [MonoTODO]
                public string GetNameInfo (X509NameType nameType, bool forIssuer) 
                {
                        return null;
@@ -212,11 +218,13 @@ namespace System.Security.Cryptography.X509Certificates {
                        base.Reset ();
                }
 
+               [MonoTODO]
                public override string ToString ()
                {
                        return null;
                }
 
+               [MonoTODO]
                public override string ToString (bool verbose)
                {
                        return null;
@@ -224,11 +232,13 @@ namespace System.Security.Cryptography.X509Certificates {
 
                // static methods
 
+               [MonoTODO]
                public static X509ContentType GetCertContentType (byte[] rawData)
                {
                        return X509ContentType.Unknown;
                }
 
+               [MonoTODO]
                public static X509ContentType GetCertContentType (string fileName)
                {
                        return X509ContentType.Unknown;
index bc251b5403142d3a51e372d33b93fa994d08cdb9..9665a9be8b728d2839b15d52f7cfec29577ad8e4 100755 (executable)
@@ -1,13 +1,11 @@
 //
-// X509Chain.cs - System.Security.Cryptography.X509Certificates.X509Chain
+// System.Security.Cryptography.X509Certificates.X509Chain
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
 // "Software"), to deal in the Software without restriction, including
@@ -34,8 +32,6 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
        public class X509Chain {
 
                private bool _machineContext;
@@ -45,7 +41,9 @@ namespace System.Security.Cryptography.X509Certificates {
 
                // constructors
 
-               public X509Chain () : this (false) {}
+               public X509Chain () : this (false)
+               {
+               }
 
                public X509Chain (bool useMachineContext) 
                {
@@ -80,6 +78,11 @@ namespace System.Security.Cryptography.X509Certificates {
                        return false;
                }
 
+               [MonoTODO]
+               public void Reset () 
+               {
+               }
+
                // static methods
 
                public static X509Chain Create ()
@@ -89,4 +92,4 @@ namespace System.Security.Cryptography.X509Certificates {
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index ca86185361630510445353ad389f4276ee970265..41cbbccc6f895c833fe04849131dff1fb189c976 100755 (executable)
@@ -2,11 +2,10 @@
 // X509ChainStatusFlags.cs - System.Security.Cryptography.X509Certificates.X509ChainStatusFlags
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,33 +33,33 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Flags]
+       [Serializable]
        public enum X509ChainStatusFlags {
-               NoError,
-               NotTimeValid,
-               NotTimeNested,
-               Revoked,
-               NotSignatureValid,
-               NotValidForUsage,
-               UntrustedRoot,
-               RevocationStatusUnknown,
-               Cyclic,
-               InvalidExtension,
-               InvalidPolicyConstraints,
-               InvalidBasicConstraints,
-               InvalidNameConstraints,
-               HasNotSupportedNameConstraint,
-               HasNotDefinedNameConstraint,
-               HasNotPermittedNameConstraint,
-               HasExcludedNameConstraint,
-               PartialChain,
-               CtlNotTimeValid,
-               CtlNotSignatureValid,
-               CtlNotValidForUsage,
-               OfflineRevocation,
-               NoIssuanceChainPolicy
+               NoError = 0,
+               NotTimeValid = 1,
+               NotTimeNested = 2,
+               Revoked = 4,
+               NotSignatureValid = 8,
+               NotValidForUsage = 16,
+               UntrustedRoot = 32,
+               RevocationStatusUnknown = 64,
+               Cyclic = 128,
+               InvalidExtension = 256,
+               InvalidPolicyConstraints = 512,
+               InvalidBasicConstraints = 1024,
+               InvalidNameConstraints = 2048,
+               HasNotSupportedNameConstraint = 4096,
+               HasNotDefinedNameConstraint = 8192,
+               HasNotPermittedNameConstraint = 16384,
+               HasExcludedNameConstraint = 32768,
+               PartialChain = 65536,
+               CtlNotTimeValid = 131072,
+               CtlNotSignatureValid = 262144,
+               CtlNotValidForUsage = 524288,
+               OfflineRevocation = 16777216,
+               NoIssuanceChainPolicy = 33554432
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index f9132c93107b3d3636df7e3f3a362fd30995752e..d8e9a56ad3267b12b07c8dcb0ab4858183287dfb 100755 (executable)
@@ -1,12 +1,11 @@
 //
-// X509Extension.cs - System.Security.Cryptography.X509Extension
+// System.Security.Cryptography.X509Certificates.X509Extension
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,17 +33,15 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
-       public class X509Extension {
+       public class X509Extension : AsnEncodedData {
 
                private bool _critical;
-               private AsnEncodedData _extn;
-               private Oid _oid;
 
                // constructors
 
-               protected X509Extension () {}
+               protected X509Extension () 
+               {
+               }
 
                // properties
 
@@ -52,26 +49,15 @@ namespace System.Security.Cryptography.X509Certificates {
                        get { return _critical; }
                }
 
-               public AsnEncodedData EncodedExtension {
-                       get  { return _extn; }
-               }
-
-               public Oid Oid {
-                       get { return _oid; }
-               }
-
                // methods
 
-               public virtual void CopyFrom (X509Extension extension) 
+               [MonoTODO ("decode with Mono.Security")]
+               public override void CopyFrom (AsnEncodedData asnEncodedData) 
                {
-                       if (extension == null)
-                               throw new ArgumentNullException ("extension");
-
-                       _critical = extension._critical;
-                       _extn = extension._extn;
-                       _oid = extension._oid;
+                       if (asnEncodedData == null)
+                               throw new ArgumentNullException ("asnEncodedData");
                }
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 942898350becb32b81888df2384bcd310823ae48..9793162b7f9139b547e54e486c3268518c4530af 100755 (executable)
@@ -1,12 +1,11 @@
 //
-// X509ExtensionCollection.cs - System.Security.Cryptography.X509ExtensionCollection
+// System.Security.Cryptography.X509Certificates.X509ExtensionCollection
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -35,34 +34,46 @@ using System.Collections;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
        public sealed class X509ExtensionCollection : ICollection, IEnumerable {
 
+               private ArrayList _list;
+
+               internal X509ExtensionCollection ()
+               {
+                       _list = new ArrayList ();
+               }
+
                // properties
 
                public int Count {
-                       get { return 0; }
+                       get { return _list.Count; }
                }
 
                public bool IsSynchronized {
-                       get { return false; }
+                       get { return _list.IsSynchronized; }
                }
 
                public object SyncRoot {
-                       get { return null; }
+                       get { return _list.SyncRoot; }
                }
 
                public X509Extension this [int index] {
-                       get { return null; }
+                       get { return (X509Extension) _list [index]; }
                }
 
+               [MonoTODO ("iterate to find oid")]
                public X509Extension this [string oid] {
-                       get { return null; }
+                       get { return (X509Extension) null; }
                }
 
                // methods
 
+               public int Add (X509Extension extension) 
+               {
+                       return _list.Add (extension);
+               }
+
+               [MonoTODO]
                public void CopyTo (X509Extension[] array, int index) 
                {
                        if (array == null)
@@ -75,6 +86,7 @@ namespace System.Security.Cryptography.X509Certificates {
 
                void ICollection.CopyTo (Array array, int index)
                {
+                       _list.CopyTo (array, index);
                }
 
                public X509ExtensionEnumerator GetEnumerator () 
@@ -89,4 +101,4 @@ namespace System.Security.Cryptography.X509Certificates {
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index fd5a810918f1a46caa80da0ac57688d636bec3f1..7ebc8b7288094fdf86b2769632951fbd72657a63 100755 (executable)
@@ -2,11 +2,10 @@
 // X509FindType.cs - System.Security.Cryptography.X509Certificates.X509FindType
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,8 +33,7 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum X509FindType {
                FindByThumbprint,
                FindBySubjectName,
@@ -48,10 +46,11 @@ namespace System.Security.Cryptography.X509Certificates {
                FindByTimeExpired,
                FindByTemplateName,
                FindByApplicationPolicy,
+               FindByCertificatePolicy,
                FindByExtension,
                FindByKeyUsage,
-               FindBySubjectKeyIdentifier
+               FindBySubjectKeyIdentifier,
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index a05d1968a3bd3793efa5790ea2469de77c17e3f9..0699eac0a1a09061a2873c5af4c52c9fef72647d 100755 (executable)
@@ -2,11 +2,10 @@
 // X509IncludeOption.cs - System.Security.Cryptography.X509IncludeOption
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,8 +33,7 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum X509IncludeOption {
                None,
                ExcludeRoot,
@@ -44,4 +42,4 @@ namespace System.Security.Cryptography.X509Certificates {
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 3a338d4757f603c3215a3379734a3f29e9417623..e104e5d1603c68757d21492a7df830df1b5ba405 100755 (executable)
@@ -2,11 +2,10 @@
 // X509KeyUsageFlags.cs - System.Security.Cryptography.X509Certificates.X509KeyUsageFlags
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,19 +33,19 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Flags]
+       [Serializable]
        public enum X509KeyUsageFlags {
-               EncipherOnly,
-               CRLSign,
-               KeyCertSign,
-               KeyAgreement,
-               DataEncipherment,
-               KeyEncipherment,
-               NonRepudiation,
-               DigitalSignature,
-               DecipherOnly
+               EncipherOnly = 1,
+               CRLSign = 2,
+               KeyCertSign = 4,
+               KeyAgreement = 8,
+               DataEncipherment = 16,
+               KeyEncipherment = 32,
+               NonRepudiation = 64,
+               DigitalSignature = 128,
+               DecipherOnly = 32768
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 243523f06ab8740ebf0689907f6d46f9ef1480a9..a425ebdfc3c81e237c455e83f3f45d030dd805b1 100755 (executable)
@@ -2,11 +2,10 @@
 // X509NameType.cs - System.Security.Cryptography.X509NameType
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,15 +33,14 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum X509NameType {
-               SimpleName,
-               EmailName,
-               UpnName,
-               DnsName,
-               UrlName
+               SimpleName = 1,
+               EmailName = 2,
+               UpnName = 3,
+               DnsName = 4,
+               UrlName = 5
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 9a6795e31dd5d3ace042a923fd8a42b136df924d..e8ea5c0fe507aef051b1d96c69c43f12dc49fabc 100755 (executable)
@@ -2,11 +2,10 @@
 // X509RevocationFlag.cs - System.Security.Cryptography.X509Certificates.X509RevocationFlag
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,13 +33,12 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum X509RevocationFlag {
-               EndCertificateOnly,
-               EntireChain,
-               ExcludeRoot
+               EndCertificateOnly = 1,
+               EntireChain = 2,
+               ExcludeRoot = 4
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index e031a6f0ac6a45c0eebd04c7e15fe0831514cd35..fa7fa4f3432a4eb7b6fafef243203b58f6dc98b6 100755 (executable)
@@ -2,11 +2,10 @@
 // X509RevocationMode.cs - System.Security.Cryptography.X509Certificates.X509RevocationMode
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,8 +33,7 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum X509RevocationMode {
                NoCheck,
                Online,
@@ -43,4 +41,4 @@ namespace System.Security.Cryptography.X509Certificates {
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index 02227b691fcd4dbdb1b82ff89fe3b2054989975e..75381deaa9939435f94eb6935036d8f5431517b3 100755 (executable)
@@ -1,12 +1,11 @@
 //
-// X509SelectionFlag.cs - System.Security.Cryptography.X509Certificates.X509SelectionFlag
+// System.Security.Cryptography.X509Certificates.X509SelectionFlag
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,12 +33,11 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Serializable]
        public enum X509SelectionFlag {
                SingleSelection,
                MultiSelection
        }
 }
 
-#endif
\ No newline at end of file
+#endif
index d0b72056938720a9d1bfa376a40a1119c13c9e94..713c15a5bc03242a824557c10b86009598f9771a 100755 (executable)
@@ -2,11 +2,10 @@
 // X509VerificationFlags.cs - System.Security.Cryptography.X509Certificates.X509VerificationFlags
 //
 // Author:
-//     Sebastien Pouliot (spouliot@motus.com)
+//     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 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
 // a copy of this software and associated documentation files (the
@@ -34,24 +33,28 @@ using System;
 
 namespace System.Security.Cryptography.X509Certificates {
 
-       // Note: Match the definition of framework version 1.2.3400.0 on http://longhorn.msdn.microsoft.com
-
+       [Flags]
+       [Serializable]
        public enum X509VerificationFlags {
-               NoFlag,
-               IgnoreNotTimeValid,
-               IgnoreCtlNotTimeValid,
-               IgnoreNotTimeNested,
-               IgnoreInvalidBasicConstraints,
-               AllowUnknownCertificateAuthority,
-               IgnoreWrongUsage,
-               IgnoreInvalidName,
-               IgnoreInvalidPolicy,
-               IgnoreEndRevocationUnknown,
-               IgnoreCtlSignerRevocationUnknown,
-               IgnoreCertificateAuthorityRevocationUnknown,
-               IgnoreRootRevocationUnknown,
-               AllFlags
+               NoFlag = 0,
+               IgnoreNotTimeValid = 1,
+               IgnoreCtlNotTimeValid = 2,
+               IgnoreNotTimeNested = 4,
+               IgnoreInvalidBasicConstraints = 8,
+               AllowUnknownCertificateAuthority = 16,
+               IgnoreWrongUsage = 32,
+               IgnoreInvalidName = 64,
+               IgnoreInvalidPolicy = 128,
+               IgnoreEndRevocationUnknown = 256,
+               IgnoreCtlSignerRevocationUnknown = 512,
+               IgnoreCertificateAuthorityRevocationUnknown = 1024,
+               IgnoreRootRevocationUnknown = 2048,
+               AllFlags = IgnoreNotTimeValid | IgnoreCtlNotTimeValid | IgnoreNotTimeNested |
+                       IgnoreInvalidBasicConstraints | AllowUnknownCertificateAuthority |
+                       IgnoreWrongUsage | IgnoreInvalidName | IgnoreInvalidPolicy | 
+                       IgnoreEndRevocationUnknown | IgnoreCtlSignerRevocationUnknown |
+                       IgnoreCertificateAuthorityRevocationUnknown | IgnoreRootRevocationUnknown
        }
 }
 
-#endif
\ No newline at end of file
+#endif