diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2004-09-07 16:21:14 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2004-09-07 16:21:14 +0400 |
commit | b00cb32b2d98a6a369e722c6823bb05220228844 (patch) | |
tree | 030cd0296b158103074b056af07ee7e18190d365 /mcs | |
parent | 0f56a667b8d64f233391042895b5ad1d7ddada09 (diff) |
2004-09-07 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs: Merge enhancements from HEAD. Now allows users to
manipulate the machine's cert store (not just the user's store).
svn path=/branches/mono-1-0/mcs/; revision=33508
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/tools/security/ChangeLog | 5 | ||||
-rwxr-xr-x | mcs/tools/security/certmgr.cs | 34 |
2 files changed, 28 insertions, 11 deletions
diff --git a/mcs/tools/security/ChangeLog b/mcs/tools/security/ChangeLog index 95500607f1b..1b42f284e25 100644 --- a/mcs/tools/security/ChangeLog +++ b/mcs/tools/security/ChangeLog @@ -1,3 +1,8 @@ +2004-09-07 Sebastien Pouliot <sebastien@ximian.com> + + * certmgr.cs: Merge enhancements from HEAD. Now allows users to + manipulate the machine's cert store (not just the user's store). + 2004-08-02 Sebastien Pouliot <sebastien@ximian.com> * AssemblyInfo.cs: Update version number for Mono 1.0.1. diff --git a/mcs/tools/security/certmgr.cs b/mcs/tools/security/certmgr.cs index af59cc720c4..53bb97d28f5 100755 --- a/mcs/tools/security/certmgr.cs +++ b/mcs/tools/security/certmgr.cs @@ -4,7 +4,7 @@ // Author: // Sebastien Pouliot <sebastien@ximian.com> // -// (C) 2004 Novell (http://www.novell.com) +// Copyright (C) 2004 Novell, Inc (http://www.novell.com) // using System; @@ -51,6 +51,7 @@ namespace Mono.Tools { Console.WriteLine ("\t-crl\tadd/del/put certificate revocation lists"); Console.WriteLine ("\t-ctl\tadd/del/put certificate trust lists [unsupported]"); Console.WriteLine ("other options"); + Console.WriteLine ("\t-m\tuse the machine certificate store (default to user)"); Console.WriteLine ("\t-v\tverbose mode (display status for every steps)"); Console.WriteLine ("\t-?\th[elp]\tDisplay this help message"); } @@ -246,7 +247,8 @@ namespace Mono.Tools { static void Delete (ObjectType type, X509Store store, string file, bool verbose) { - switch (type) { + throw new NotImplementedException ("Delete not yet supported"); +/* switch (type) { case ObjectType.Certificate: break; case ObjectType.CRL: @@ -254,12 +256,13 @@ namespace Mono.Tools { break; default: throw new NotSupportedException (type.ToString ()); - } + }*/ } static void Put (ObjectType type, X509Store store, string file, bool verbose) { - switch (type) { + throw new NotImplementedException ("Put not yet supported"); +/* switch (type) { case ObjectType.Certificate: break; case ObjectType.CRL: @@ -267,7 +270,7 @@ namespace Mono.Tools { break; default: throw new NotSupportedException (type.ToString ()); - } + }*/ } [STAThread] @@ -295,9 +298,12 @@ namespace Mono.Tools { bool verbose = (GetCommand (args [n]) == "V"); if (verbose) n++; + bool machine = (GetCommand (args [n]) == "M"); + if (machine) + n++; string storeName = args [n++]; - X509Store store = GetStoreFromName (storeName, false); + X509Store store = GetStoreFromName (storeName, machine); if (store == null) { Console.WriteLine ("Invalid Store: {0}", storeName); Console.WriteLine ("Valid stores are: {0}, {1}, {2}, {3} and {4}", @@ -312,18 +318,24 @@ namespace Mono.Tools { string file = args [n]; // now action! - switch (action) { + try { + switch (action) { case Action.Add: Add (type, store, file, verbose); break; case Action.Delete: - throw new NotImplementedException ("Delete not yet supported"); - //Delete (type, store, file, verbose); + Delete (type, store, file, verbose); break; case Action.Put: - throw new NotImplementedException ("Put not yet supported"); - //Put (type, store, file, verbose); + Put (type, store, file, verbose); break; + default: + throw new NotSupportedException (action.ToString ()); + } + } + catch (UnauthorizedAccessException) { + Console.WriteLine ("Access to the {0} '{1}' certificate store has been denied.", + (machine ? "machine" : "user"), storeName); } } } |