Fix mixed newlines
authorMarek Habersack <grendel@twistedcode.net>
Wed, 3 Nov 2010 02:26:26 +0000 (03:26 +0100)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 3 Nov 2010 02:26:26 +0000 (03:26 +0100)
mcs/class/Mono.Security/Mono.Security.X509/X509StoreManager.cs
mcs/class/corlib/Mono.Security.X509/X509StoreManager.cs
mcs/class/corlib/System.Security.Cryptography/RSACryptoServiceProvider.cs
mcs/tools/security/certmgr.cs

index bbdef604c11fa30886834e3f253904a0d29cd2ec..db735834acd4ca39c0310cca71612eeadac7a7c9 100644 (file)
@@ -41,8 +41,8 @@ namespace Mono.Security.X509 {
 #else
        public 
 #endif
-       sealed class X509StoreManager {\r
-\r
+       sealed class X509StoreManager {
+
                static private string _userPath;
                static private string _localMachinePath;
                static private X509Stores _userStore;
@@ -53,32 +53,32 @@ namespace Mono.Security.X509 {
                }
 
                internal static string CurrentUserPath {
-                       get {\r
-                               if (_userPath == null) {\r
-                                       _userPath = Path.Combine(\r
-                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),\r
-                                                       ".mono");\r
-                                       _userPath = Path.Combine(_userPath, "certs");\r
-                               }\r
+                       get {
+                               if (_userPath == null) {
+                                       _userPath = Path.Combine(
+                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+                                                       ".mono");
+                                       _userPath = Path.Combine(_userPath, "certs");
+                               }
                                return _userPath;
                        }
-               }\r
-\r
-               internal static string LocalMachinePath {\r
-                       get {\r
+               }
+
+               internal static string LocalMachinePath {
+                       get {
                                if (_localMachinePath == null) {
                                        _localMachinePath = Path.Combine (
                                                Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData),
                                                ".mono");
-                                       _localMachinePath = Path.Combine (_localMachinePath, "certs");\r
-                               }\r
-                               return _localMachinePath;\r
-                       }\r
+                                       _localMachinePath = Path.Combine (_localMachinePath, "certs");
+                               }
+                               return _localMachinePath;
+                       }
                }
 
                static public X509Stores CurrentUser {
                        get { 
-                               if (_userStore == null)\r
+                               if (_userStore == null)
                                        _userStore = new X509Stores(CurrentUserPath);
                                
                                return _userStore;
index bbdef604c11fa30886834e3f253904a0d29cd2ec..db735834acd4ca39c0310cca71612eeadac7a7c9 100644 (file)
@@ -41,8 +41,8 @@ namespace Mono.Security.X509 {
 #else
        public 
 #endif
-       sealed class X509StoreManager {\r
-\r
+       sealed class X509StoreManager {
+
                static private string _userPath;
                static private string _localMachinePath;
                static private X509Stores _userStore;
@@ -53,32 +53,32 @@ namespace Mono.Security.X509 {
                }
 
                internal static string CurrentUserPath {
-                       get {\r
-                               if (_userPath == null) {\r
-                                       _userPath = Path.Combine(\r
-                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),\r
-                                                       ".mono");\r
-                                       _userPath = Path.Combine(_userPath, "certs");\r
-                               }\r
+                       get {
+                               if (_userPath == null) {
+                                       _userPath = Path.Combine(
+                                                       Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
+                                                       ".mono");
+                                       _userPath = Path.Combine(_userPath, "certs");
+                               }
                                return _userPath;
                        }
-               }\r
-\r
-               internal static string LocalMachinePath {\r
-                       get {\r
+               }
+
+               internal static string LocalMachinePath {
+                       get {
                                if (_localMachinePath == null) {
                                        _localMachinePath = Path.Combine (
                                                Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData),
                                                ".mono");
-                                       _localMachinePath = Path.Combine (_localMachinePath, "certs");\r
-                               }\r
-                               return _localMachinePath;\r
-                       }\r
+                                       _localMachinePath = Path.Combine (_localMachinePath, "certs");
+                               }
+                               return _localMachinePath;
+                       }
                }
 
                static public X509Stores CurrentUser {
                        get { 
-                               if (_userStore == null)\r
+                               if (_userStore == null)
                                        _userStore = new X509Stores(CurrentUserPath);
                                
                                return _userStore;
index cf8b7e958ee2fb4076b12eaf89faf2911458a9cc..822db5bb72e25648ae21abe1ab2f7e7c9aef76d1 100644 (file)
@@ -362,7 +362,7 @@ namespace System.Security.Cryptography {
 
                [ComVisible (false)]
                public CspKeyContainerInfo CspKeyContainerInfo {
-                       get {\r
+                       get {
                                return new CspKeyContainerInfo(store.Parameters);
                        }
                }
index 1cf1789070e58344aa7bc22a7a7063855cef5291..5251bf91e79d2c248cf4a78e4a4e685f8213e631 100644 (file)
@@ -8,9 +8,9 @@
 //
 
 using System;
-using System.Collections;\r
+using System.Collections;
 using System.Globalization;
-using System.IO;\r
+using System.IO;
 using System.Net;
 using System.Net.Sockets;
 using System.Reflection;
@@ -48,7 +48,7 @@ namespace Mono.Tools {
                        Console.WriteLine ("\t-del\t\tRemove a certificate, CRL or CTL to specified store");
                        Console.WriteLine ("\t-put\t\tCopy a certificate, CRL or CTL from a store to a file");
                        Console.WriteLine ("\t-list\t\tList certificates, CRL ot CTL in the specified store.");
-                       Console.WriteLine ("\t-ssl\t\tDownload and add certificates from an SSL session");\r
+                       Console.WriteLine ("\t-ssl\t\tDownload and add certificates from an SSL session");
                        Console.WriteLine ("\t-importKey\tImport PKCS12 privateKey to keypair store.");
                        Console.WriteLine ("object types");
                        Console.WriteLine ("\t-c\t\tadd/del/put certificates");
@@ -56,7 +56,7 @@ namespace Mono.Tools {
                        Console.WriteLine ("\t-ctl\t\tadd/del/put certificate trust lists [unsupported]");
                        Console.WriteLine ("other options");
                        Console.WriteLine ("\t-m\t\tuse the machine certificate store (default to user)");
-                       Console.WriteLine ("\t-v\t\tverbose mode (display status for every steps)");\r
+                       Console.WriteLine ("\t-v\t\tverbose mode (display status for every steps)");
                        Console.WriteLine ("\t-p [password]\tPassword used to decrypt PKCS12");
                        Console.WriteLine ("\t-?\t\th[elp]\tDisplay this help message");
                        Console.WriteLine ();
@@ -112,8 +112,8 @@ namespace Mono.Tools {
                                case "TLS":
                                        action = Action.Ssl;
                                        break;
-                               case "IMPORTKEY":\r
-                                       action = Action.ImportKey;\r
+                               case "IMPORTKEY":
+                                       action = Action.ImportKey;
                                        break;
                        }
                        return action;
@@ -203,25 +203,25 @@ namespace Mono.Tools {
                                                coll.Add (x509);
                                        break;
                                case ".P12":
-                               case ".PFX":\r
-                                       PKCS12 p12 = password == null ? PKCS12.LoadFromFile (filename)\r
-                                               : PKCS12.LoadFromFile (filename, password);\r
-                                       X509CertificateCollection tmp = new X509CertificateCollection (p12.Certificates);\r
-\r
-                                       for (int i = 0; i != p12.Keys.Count; i++) {\r
-                                               X509Certificate cert = p12.Certificates[i];\r
-                                               RSACryptoServiceProvider pk = p12.Keys[i] as RSACryptoServiceProvider;\r
-\r
-                                               if (pk == null || pk.PublicOnly)\r
-                                                       continue;\r
-\r
-                                               if (verbose)\r
-                                                       Console.WriteLine ("Found key for certificate: {0}", cert.SubjectName);\r
-\r
-                                               tmp[0].RSA = pk;\r
-                                       }\r
+                               case ".PFX":
+                                       PKCS12 p12 = password == null ? PKCS12.LoadFromFile (filename)
+                                               : PKCS12.LoadFromFile (filename, password);
+                                       X509CertificateCollection tmp = new X509CertificateCollection (p12.Certificates);
+
+                                       for (int i = 0; i != p12.Keys.Count; i++) {
+                                               X509Certificate cert = p12.Certificates[i];
+                                               RSACryptoServiceProvider pk = p12.Keys[i] as RSACryptoServiceProvider;
+
+                                               if (pk == null || pk.PublicOnly)
+                                                       continue;
+
+                                               if (verbose)
+                                                       Console.WriteLine ("Found key for certificate: {0}", cert.SubjectName);
+
+                                               tmp[0].RSA = pk;
+                                       }
                                        coll.AddRange(tmp);
-                                       p12 = null;\r
+                                       p12 = null;
                                        break;
                                default:
                                        Console.WriteLine ("Unknown file extension: {0}", 
@@ -345,9 +345,9 @@ namespace Mono.Tools {
                                Console.WriteLine ("  Private Key:                      {0}", ((rsaCsp != null && !rsaCsp.PublicOnly) 
                                        || (rsaManaged != null && !rsaManaged.PublicOnly)));
                                CspParameters cspParams = new CspParameters ();
-                               cspParams.KeyContainerName = CryptoConvert.ToHex (x509.Hash);\r
-                               cspParams.Flags = machine ? CspProviderFlags.UseMachineKeyStore : 0;\r
-                               KeyPairPersistence kpp = new KeyPairPersistence (cspParams);\r
+                               cspParams.KeyContainerName = CryptoConvert.ToHex (x509.Hash);
+                               cspParams.Flags = machine ? CspProviderFlags.UseMachineKeyStore : 0;
+                               KeyPairPersistence kpp = new KeyPairPersistence (cspParams);
                                Console.WriteLine ("  KeyPair Key:                      {0}", kpp.Load ());
                        }
                        Console.WriteLine ();
@@ -514,21 +514,21 @@ namespace Mono.Tools {
                {
                        switch (type) {
                                case ObjectType.Certificate:
-                                       X509CertificateCollection coll = LoadCertificates (file, password, verbose);\r
+                                       X509CertificateCollection coll = LoadCertificates (file, password, verbose);
                                        int count = 0;
 
-                                       foreach (X509Certificate x509 in coll) {\r
-                                               RSACryptoServiceProvider pk = x509.RSA as RSACryptoServiceProvider;\r
-\r
-                                               if (pk == null || pk.PublicOnly)\r
-                                                       continue;\r
-\r
-                                               CspParameters csp = new CspParameters ();\r
-                                               csp.KeyContainerName = CryptoConvert.ToHex (x509.Hash);\r
-                                               csp.Flags = machine ? CspProviderFlags.UseMachineKeyStore : 0;\r
-                                               RSACryptoServiceProvider rsa = new RSACryptoServiceProvider (csp);\r
-                                               rsa.ImportParameters (pk.ExportParameters (true));\r
-                                               rsa.PersistKeyInCsp = true;\r
+                                       foreach (X509Certificate x509 in coll) {
+                                               RSACryptoServiceProvider pk = x509.RSA as RSACryptoServiceProvider;
+
+                                               if (pk == null || pk.PublicOnly)
+                                                       continue;
+
+                                               CspParameters csp = new CspParameters ();
+                                               csp.KeyContainerName = CryptoConvert.ToHex (x509.Hash);
+                                               csp.Flags = machine ? CspProviderFlags.UseMachineKeyStore : 0;
+                                               RSACryptoServiceProvider rsa = new RSACryptoServiceProvider (csp);
+                                               rsa.ImportParameters (pk.ExportParameters (true));
+                                               rsa.PersistKeyInCsp = true;
                                                count++;
                                        }
                                        Console.WriteLine ("{0} keys(s) imported to KeyPair {1} persister.", 
@@ -541,7 +541,7 @@ namespace Mono.Tools {
 
                [STAThread]
                static void Main (string[] args)
-               {\r
+               {
                        string password = null;
 
                        Header ();
@@ -567,10 +567,10 @@ namespace Mono.Tools {
                        if (machine)
                                n++;
 
-                       if (GetCommand (args [n]) == "P")\r
-                       {\r
-                               n++;\r
-                               password = args[n++];\r
+                       if (GetCommand (args [n]) == "P")
+                       {
+                               n++;
+                               password = args[n++];
                        }
 
                        X509Store store = null;
@@ -619,8 +619,8 @@ namespace Mono.Tools {
                                case Action.Ssl:
                                        Ssl (file, machine, verbose);
                                        break;
-                               case Action.ImportKey:\r
-                                       ImportKey (type, machine, file, password, verbose);\r
+                               case Action.ImportKey:
+                                       ImportKey (type, machine, file, password, verbose);
                                        break;
                                default:
                                        throw new NotSupportedException (action.ToString ());