Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
//
// AssemblyInfo.cs: Assembly Informations
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2004-2008 Novell Inc. (http://www.novell.com)
//
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
// AssemblyTitle - included in tool's source code
// AssemblyDescription - included in tool's source code
[assembly: AssemblyCompany("Motus Technologies, Novell")]
[assembly: AssemblyProduct("Mono Security Tools")]
[assembly: AssemblyCopyright("Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.")]
[assembly: AssemblyVersion (Consts.MonoVersion)]
//[assembly: AssemblyConfiguration("")]
//[assembly: AssemblyTrademark("")]
//[assembly: AssemblyCulture("")]
//[assembly: AssemblyDelaySign(true)]
//[assembly: AssemblyKeyFile("sectools.pub")]
//[assembly: AssemblyKeyName("")]
namespace Mono.Tools {
public class AssemblyInfo {
private string _name;
private string _title;
private string _copyright;
private string _description;
private string _version;
public AssemblyInfo ()
: this (Assembly.GetExecutingAssembly ())
{
}
public AssemblyInfo (Assembly a)
{
if (a == null)
throw new ArgumentNullException ("a");
AssemblyName an = a.GetName ();
_name = an.ToString ();
object [] att = a.GetCustomAttributes (typeof (AssemblyTitleAttribute), false);
_title = ((att.Length > 0) ? ((AssemblyTitleAttribute) att [0]).Title : String.Empty);
att = a.GetCustomAttributes (typeof (AssemblyCopyrightAttribute), false);
_copyright = ((att.Length > 0) ? ((AssemblyCopyrightAttribute) att [0]).Copyright : String.Empty);
att = a.GetCustomAttributes (typeof (AssemblyDescriptionAttribute), false);
_description = ((att.Length > 0) ? ((AssemblyDescriptionAttribute) att [0]).Description : String.Empty);
_version = an.Version.ToString ();
}
public string Copyright {
get { return _copyright; }
}
public string Description {
get { return _description; }
}
public string Name {
get { return _name; }
}
public string Title {
get { return _title; }
}
public string Version {
get { return _version; }
}
public override string ToString ()
{
StringBuilder sb = new StringBuilder ();
sb.AppendFormat ("{1} - version {2}{0}{3}{0}{4}{0}",
Environment.NewLine,
_title, _version,
_description,
_copyright);
return sb.ToString ();
}
}
}

View File

@@ -0,0 +1,416 @@
2010-06-16 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs: Fix case where DSA is used in SSL certificate (rare
enough that this was never found/reported). Suggest novell's
bugzilla (instead of ximian)
2009-04-16 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs: Don't throw if we're missing an argument. Fix by
Romain Tartiere (bug #464765). Updated help to specify that
"option type" is mandatory in some cases.
2008-10-17 Jonathan Pryor <jpryor@novell.com>
* Makefile: Add doc-update target support.
2008-03-13 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update copyright notices.
* sn.cs: Display a better error message if an assembly is not
strongnamed but yet delay-signed (the old one succeeded to confuse
myself ;-). Display messages from CryptographicException since
those are not unknown errors (like other exceptions).
2007-12-17 Gert Driesen <drieseng@users.sourceforge.net>
* certmgr.cs: Fixed reflection magic to look for ServerCertificates in
SslStreamBase. This avoids breakage once patch for bug #349078 is
applied. Added support for removing CRL's from store.
2007-10-17 Sebastien Pouliot <sebastien@ximian.com>
* sn.cs: Fix help for -T / -t as this shows the public key token
(and not the public key). Patch by Andy Hume. Fix bug #334507
2007-07-31 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update copyright notices.
* Makefile: Build the *full*, Cecil-enabled, permview.
* permview.cs: Updated from Cecil repository.
2007-04-26 Sebastien Pouliot <sebastien@ximian.com>
* signcode.cs: Fix individual/commercial mixup (#81462).
2007-02-28 Wade Berrier <wberrier@novell.com>
* Makefile: Consolidate more lists and make some
2.0 friendly vars (ultimately to include httpcfg.cs in
make dist)
2007-02-28 Wade Berrier <wberrier@novell.com>
* Makefile: install httpcfg.exe in the 2.0 profile
and keep old list of programs for 1.0 profile
2007-02-27 Sebastien Pouliot <sebastien@ximian.com>
* signcode.cs: Handle passowrd-protected PVK files correctly. Fix
bug #80924.
2006-12-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Makefile:
* httpcfg.cs: new tool that handles certificates used in HttpListener.
2006-12-14 Sebastien Pouliot <sebastien@ximian.com>
* chktrust.cs: Display the error even if the root is trusted.
2006-12-05 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs: Support adding CRL into certificate stores.
2006-08-17 Sebastien Pouliot <sebastien@ximian.com>
* sn.cs: Add support for PKCS#12/PFX password protected files (just
like available in fx 2.0).
* TESTS: Add a test sequence to verify changes in SN.
* Makefile: Distribute TESTS in tarballs.
2006-07-31 Sebastien Pouliot <sebastien@ximian.com>
* sn.cs: Catch exceptions, including reporting invalid number of
parameters. Fix bug #78977.
2006-06-14 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update copyright notice.
* signcode.cs: Add support for -x (delayed timestamp) to fix bug
#78614. Now the tool is more useful in real-life scenarios.
* TESTS: New. Instructions on how to test any changes related to
Authenticode.
2006-05-09 Sebastien Pouliot <sebastien@ximian.com>
* sn.cs: Don't throw an exception on invalid assemblies (e.g.
netmodules). Fixed some typos.
2006-03-15 Hector E. Gomez Morales <hectorgm@ciencias.unam.mx>
* secutil.cs: Print an error when asked to display the strong name
of an assembly that doesn't have an associated key.
2005-11-04 Sebastien Pouliot <sebastien@ximian.com>
* sn.cs: Added optional keysize argument to -k (generate keypair).
This is required as 2.0 allows key length from 384 to 16384 bits (i.e.
which are the CryptoAPI limitations on RSA).
2005-10-12 Sebastien Pouliot <sebastien@ximian.com>
* mozroots.cs: Fix confirmations and "really" import the certificates.
2005-10-11 Sebastien Pouliot <sebastien@ximian.com>
* Makefile: Add mozroot to the build.
* mozroots.cs: A new command-line tool to download and import the list
of Mozilla's trusted root certificates into Mono's stores.
2005-09-23 Sebastien Pouliot <sebastien@ximian.com>
* makecert.cs: For PKCS#12, added localKeyID attribute support, for
certificates and keys, so Windows can import both as a single entity.
2005-08-26 Kornél Pál <kornelpal@hotmail.com>
* AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
* Makefile: Using Consts.MonoVersion instead of MonoVersion.cs.
2005-06-30 Sebastien Pouliot <sebastien@ximian.com>
* Makefile: restored version numbers in security tools;
* makecert.cs: Add support to generate PKCS#12 files. Changed default
hash algorithm to SHA1. Using MD5 now shows a warning. Fixed typos.
2005-06-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* MakeCert.cs: renamed to makecert.cs
* Makefile: s/MakeCert/makecert/
2005-06-09 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Bump security tools version to 1.1.8.
2005-05-02 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Bump security tools version to 1.1.7.
2005-03-14 Raja R Harinath <rharinath@novell.com>
* Makefile (install-local, uninstall-local): Disable when
NO_INSTALL is defined.
2005-02-21 Michal Moskal <malekith@pld-linux.org>
* Makefile (PROGRAM_INSTALL_DIR): Define in terms of $(libdir).
2005-01-20 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Updated copyrights to 2005.
* certmgr.cs: Added --list and implemented -del options. Fix bug 70717
* README: Updated to reflect current situation.
2005-01-19 Sebastien Pouliot <sebastien@ximian.com>
* permview.cs: Fixed case for empty, but unrestricted, permission
sets. Help now displays a more unix-like command options. Commented
some currently unused code.
2004-12-22 Sebastien Pouliot <sebastien@ximian.com>
* permview.cs: Now "works" (including /DECL) with .NET 2.0 when
compiled for NET_2_0, however Nov CTP has a bug and report all
security actions as LinkDemand.
2004-12-21 Sebastien Pouliot <sebastien@ximian.com>
* Makefile: Added permview to the build.
* permview.cs: Fixed option /OUTPUT to close the TextWriter so that
the output is available (in the file) after execution. The default
execution (without /DECL) works with a *very* recent Mono runtime.
2004-12-17 Sebastien Pouliot <sebastien@ximian.com>
* permview.cs: New. Managed declarative security permission viewer for
assemblies. The tools isn't yet part of the build as we're missing
some runtime support (for Fx 1.0/1.1).
2004-12-15 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs, signcode.cs, sn.cs: Fixlets to removed compilation
warning (for unused variables).
2004-12-13 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs: Add a new -ssl action to download and add the
certificates from an SSL connection into thr right stores.
2004-12-10 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Added a class to get informations from assembly
attributes (and remove common code from all security tools).
* caspol.cs: New. CAS policy management tool.
* cert2spc.cs: Updated to use new AssemblyInfo class.
* certmgr.cs: Updated to use new AssemblyInfo class.
* chktrust.cs: Updated to use new AssemblyInfo class.
* Makefile: Added caspol to the build.
* MakeCert.cs: Updated to use new AssemblyInfo class.
* secutil.cs: Updated to use new AssemblyInfo class.
* setreg.cs: Updated to use new AssemblyInfo class.
* signcode.cs: Updated to use new AssemblyInfo class.
* sn.cs: Updated to use new AssemblyInfo class.
2004-12-06 Atsushi Enomoto <atsushi@ximian.com>
* Makefile : test .mdb existence (for csc build).
2004-11-26 Raja R Harinath <rharinath@novell.com>
* Makefile (PROGRAM_INSTALL_DIR): Define using $(FRAMEWORK_VERSION).
2004-11-22 Raja R Harinath <rharinath@novell.com>
* Makefile (all-local) [PROFILE=net_1_1_bootstrap]: Build
profile-specific "bootstrap" sn.exe.
($(topdir)/class/lib/$(PROFILE)/sn.exe): New.
2004-10-29 Raja R Harinath <rharinath@novell.com>
* Makefile (install-local): Install .mdb files too.
(uninstall-local): Remove them.
2004-10-27 Sebastien Pouliot <sebastien@ximian.com>
* signcode.cs: -i (url) and -n (description) parameters were inverted.
2004-10-22 Sebastien Pouliot <sebastien@ximian.com>
* signcode.cs: Better error reporting (e.g. missing files).
2004-09-23 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Updated version to 1.1.2 for next release.
* MakeCert.cs: Hack for date parsing problem with Mono.
2004-08-10 Sebastien Pouliot <sebastien@ximian.com>
* certmgr.cs: Added option '-m' to add certificates to the machine
stores (default to user store). Added better handling for
UnauthorizedAccessException (e.g. non-root access to machine store).
2004-08-06 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update version number for Mono 1.1.1 (HEAD ;).
2004-08-02 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update version number for Mono 1.0.1.
* sn.cs: Warn for missing machine.config (if quiet isn't specified).
2004-06-21 Raja R Harinath <rharinath@novell.com>
* sn.cs (ReSign): Return a bool indicating success or failure.
(Main): Return with failure if ReSign() fails.
2004-06-11 Raja R Harinath <rharinath@novell.com>
* Makefile (PROGRAM_INSTALL_DIR): New define.
(install-local, uninstall-local): Use it.
2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
* StrongNameManager.cs: Fix ToString() when no verificationSettings
are present (used in sn -Vl).
* sn.cs: Fixed to match documentation.
2004-06-08 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Updated version number for post beta 2.
* StrongNameManager.cs: Changed XML format to be compatible with
machine.config. Made token uppercase.
* sn.cs: Now load the token remapping configuration from
machine.config. Fixed some errors in help.
2004-05-28 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Update version number for beta 2.
2004-04-27 Jackson Harper <jackson@ximian.com>
* sn.cs: Attempt to load the strongnames.config file from the GAC
path.
2004-04-26 Jackson Harper <jackson@ximian.com>
* Makefile: use profile libraries from the default profile.
2004-04-22 Sebastien Pouliot <sebastien@ximian.com>
* cert2spc.cs: Updated to match changes in Mono.Security.dll. Better
handling of files.
* certmgr.cs: Updated to match changes in Mono.Security.dll.
* signcode.cs: Updated to match changes in Mono.Security.dll.
2004-03-31 Sebastien Pouliot <sebastien@ximian.com>
* StrongNameManager.cs: Synched with corlib version (updated graphic).
2004-03-30 Sebastien Pouliot <sebastien@ximian.com>
* StrongNameManager.cs: New. Added a check for "*" (any) assembly
when the spcific assembly isn't found for skipping.
2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
* Makefile: Updated sn.exe to include StrongNameManager.cs.
* sn.cs: Updated to use StrongNameManager. This allows remapping a
public key token to another public key (e.g. ECMA key). Also added
support for -Vl.
* StrongNameManager.cs: New. First version. Allows remapping of
public key tokens to alternate public keys (e.g. ECMA) and disabling
strongname verification for specific tokens/assemblies/users combo.
2004-03-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* sn.cs: fixed crash in -T and -Tp.
2004-02-26 Sebastien Pouliot <sebastien@ximian.com>
* AssemblyInfo.cs: Ajusted versions, informations and copyrights.
* certmgr.cs: New. Very limited certificate manager. Allow to add new
certificates into the Trusted certificate store.
* Makefile: Added certmgr and setreg to the build.
* README: Updated.
* setreg.cs: New. Allow to add/remove test root certificates from the
trusted certificate store.
2003-11-10 Todd Berman <tberman@gentoo.org>
* sn.cs: Wow, gonzalo is so super s-m-a-r-t, changing up last fix to
make it nice and pretty.
2003-11-10 Todd Berman <tberman@gentoo.org>
* sn.cs: No more OutOfMemoryExceptions if the GetPublicKey returns
a new byte[0].
2003-10-30 Sebastien Pouliot <spouliot@videotron.ca>
* sn.cs: Fixed strongname generation for small exponents (like 17).
Part of the fixed for bug #50341.
2003-10-18 Sebastien Pouliot <spouliot@videotron.ca>
* sn.cs: Fixed a bug when exporting the public key from a SNK file.
2003-10-11 Sebastien Pouliot <spouliot@videotron.ca>
* AssemblyInfo.cs: changed version number to 0.28.99
* sn.cs: Add support for signing and verifying assemblies.
2003-09-01 Sebastien Pouliot <spouliot@videotron.ca>
* AssemblyInfo.cs: Updated version to 0.26.99 (all tools).
* cert2spc.cs: Updated to use Mono.Security.X509.
* chktrust.cs: Tool to validate Authenticode(tm) signatures on PE
files (including assemblies).
* signcode.cs: Tool to sign and timestamp PE files using
Authenticode(tm) compatible certificates.
* README: Updated to include a small tutorial on how to use
Authenticode(tm) to sign/verify assemblies.
* Makefile: Updated to build chktrust.exe and signcode.exe
2003-07-30 Sebastien Pouliot <spouliot@videotron.ca>
* AssemblyInfo.cs: Updated version to 0.25.99 (all tools).
* MakeCert.cs: Added support for Extended Key Usage (-eku).
It's now possible to create SSL certificate with the tool.
2003-06-19 Nick Drochak <ndrochak@gol.com>
* MakeCert.cs: Work around for mcs? bug 45127.
2003-03-15 Sebastien Pouliot <spouliot@videotron.ca>
* AssemblyInfo.cs: Updated version for mono 0.23.
* MakeCert.cs: New. MakeCert clone utility to create X.509
certificates (e.g. for testing Authenticode signatures).
* makefile: Added cert2spc, sn & makecert to Windows build.
* sectools.build: Added makecert to build.
2003-03-09 Sebastien Pouliot <spouliot@videotron.ca>
* makefile: Removed cert2spc and sn from linux build (as
Mono.Security assembly isn't, yet, part of the linux build).
* makefile.gnu: Removed (not required for tools).
2003-03-08 Sebastien Pouliot <spouliot@videotron.ca>
* makefile: Added SN.
* makefile.gnu: New. Copy of makefile.
* sn.cs: New. (Incomplete) SN (StrongName) tool.
* sectools.build: Updated build for SN.
2003-03-06 Sebastien Pouliot <spouliot@videotron.ca>
* AssemblyInfo.cs: New. Global assembly attributes (version and
copyright) for security tools.
* cert2spc.cs: Update to use the new PKCS7 class (from Mono.Security
assembly) and AssemblyInfo.cs. Older version was located in /mcs/tools.
* makefile: New. PROTOTYPE makefile (not tested) for Linux.
* README: New. Important information about the Mono's security tools
* secutil.cs: Updated to use AssemblyInfo.cs. Older version was located
in /mcs/tools.
* sectools.build: New. NAnt build file to build all security tools.

View File

@@ -0,0 +1,67 @@
thisdir = tools/security
SUBDIRS =
DIST_ONLY_SUBDIRS = certview
include ../../build/rules.make
LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib/$(PROFILE) -r:Mono.Security.dll
SECURITY_PROGRAMS = secutil.exe cert2spc.exe sn.exe makecert.exe chktrust.exe crlupdate.exe \
signcode.exe setreg.exe certmgr.exe caspol.exe permview.exe mozroots.exe
SECURITY_PROGRAMS_2_0 = httpcfg.exe
HELPER_SOURCES = AssemblyInfo.cs $(topdir)/build/common/Consts.cs
SN_SOURCES = sn.cs StrongNameManager.cs $(HELPER_SOURCES)
SECURITY_SOURCES = $(HELPER_SOURCES) $(SN_SOURCES) $(SECURITY_PROGRAMS:.exe=.cs) $(SECURITY_PROGRAMS_2_0:.exe=.cs)
ifeq ($(DEFAULT_PROFILE), $(PROFILE))
SECURITY_TARGETS = $(SECURITY_PROGRAMS) $(SECURITY_PROGRAMS_2_0)
endif
PROGRAM_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
DISTFILES = README TESTS $(SECURITY_SOURCES)
ifeq (build, $(PROFILE))
all-local: $(topdir)/class/lib/$(PROFILE)/sn.exe
else
all-local: $(SECURITY_TARGETS)
endif
doc-update-local:
install-local: all-local
uninstall-local:
ifndef NO_INSTALL
install-local: $(SECURITY_TARGETS)
$(MKINSTALLDIRS) $(DESTDIR)$(PROGRAM_INSTALL_DIR)
for p in $(SECURITY_TARGETS) ; do \
$(INSTALL_BIN) $$p $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
test ! -f $$p.mdb || $(INSTALL_BIN) $$p.mdb $(DESTDIR)$(PROGRAM_INSTALL_DIR) ; \
done
uninstall-local:
for p in $(SECURITY_TARGETS) ; do \
rm -f $(DESTDIR)$(PROGRAM_INSTALL_DIR)/$$p* ; \
done
endif
test-local:
run-test-local run-test-ondotnet-local csproj-local:
clean-local:
rm -f *.exe *.mdb *.pdb
rm -f $(topdir)/class/lib/$(PROFILE)/sn.exe*
dist-local: dist-default
sn.exe $(topdir)/class/lib/$(PROFILE)/sn.exe: $(SN_SOURCES)
$(CSCOMPILE) /out:$@ $(SN_SOURCES)
permview.exe: permview.cs
$(CSCOMPILE) $^ $(HELPER_SOURCES) -r:Mono.Cecil.dll
%.exe: %.cs $(HELPER_SOURCES)
$(CSCOMPILE) $^

101
mcs/tools/security/README Normal file
View File

@@ -0,0 +1,101 @@
Mono's Security Tools - README
Last updated: January 20, 2005
* General notes
- This directory contains clones for .NET security tools;
- All tools are 100% managed code with no dependency to the Mono's runtime,
except permview (which wouldn't be possible in managed code in Fx 1.0/1.1).
- A much as possible the same command line arguments as the original are used;
- Documentation (man) is available for most tools;
- Authenticode(r) support is MINIMAL - there are still many missing
validations.
* Authenticode tutorial
1. Getting a test certificate
The tool makecert.exe can create test certificates. The test certificates are
only trusted by Mono's security tools (i.e. the resulting signature won't be
valid on Windows [1]). For "real" certificates you must deal with (and pay) a
trusted commercial CA (or you can have your own CA inside your entreprise).
The command:
mono makecert.exe -n "CN=your name" -sv yourkeypair.pvk yourcert.cer
will create both a PVK file (containing your private key) and a CER file
(containing the X.509 certificate). This step will take some time because the
tools must generate your own keypair (in this case a 1024 bits RSA keypair).
example:
mono makecert.exe -n "CN=Sebastien Pouliot" -sv spouliot.pvk spouliot.cer
2. Getting a SPC file
The certificate file (.cer) must be converted into a SPC (software publisher
certificate) file before signing any assembly (or executable file).
The command:
mono cert2spc.exe yourcert.cer yourspc.spc
will create your SPC file from your X.509 certificates files.
example:
mono cert2spc.exe spouliot.cer spouliot.spc
3. Signing an assembly
You need both your PVK (private key) and SPC files to sign an assembly (or
any PE file). You may also include a countersignature in your assembly using
a timestamp server (so the signature can still be verified after your
certificate is expired).
The command:
mono signcode.exe -v yourkeypair.pvk -spc yourspc.spc -t
http://timestamp.verisign.com/scripts/timstamp.dll yourassembly.exe
will sign the specified PE file using your private key and embed your
certificate and a timestamp. Note: there are no "e" in timstamp.dll !
example:
mono signcode.exe -v spouliot.pvk -spc spouliot.spc -t
http://timestamp.verisign.com/scripts/timstamp.dll small.exe
4. Checking an assembly
Anyone can now validate the assembly signature using the chktrust tool.
The command:
mono chktrust.exe yourassembly.exe
will verify the integrity of the specified PE file. Any change to the file
will invalidate it's signature.
example:
mono chktrust.exe small.exe
[1] FOR TEST PURPOSE ONLY ON WINDOWS
As stated you can "activate" the Mono's test certificate by doing the
following steps.
a. Generate the Mono's root certificate
mono makecert.exe -r mono.cer
b. Double-click on the mono.cer file
c. Click on the "Install certificate..." button
d. Read everything then, if you still want to, answer YES to add the test
certificate in your TRUSTED root certificates.
Be warned that by doing so YOU ARE TRUSTING THIS TEST CERTIFICATE on your
system. This is bad for several reason, foremost that EVERYONE has access to
it's private key! Please remove the test certificate AS SOON as you have
finished testing using it.
--------------------
sebastien@ximian.com

View File

@@ -0,0 +1,280 @@
//
// StrongNameManager.cs - StrongName Management
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2004 Novell (http://www.novell.com)
//
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Security;
using System.Security.Cryptography;
using System.Text;
using Mono.Security.Cryptography;
using Mono.Xml;
namespace Mono.Security {
/* RUNTIME
* yes
* in_gac ---------------------------------\
* | |
* | no \/
* | return true
* CLASS LIBRARY|
* |
* |
* |
* bool StrongNameManager.MustVerify
* |
* |
* \/ not found
* Token --------------------------\
* | |
* | present ? |
* | |
* \/ not found |
* Assembly Name --------------------------|
* | |
* | present ? |
* | or "*" |
* \/ not found |
* User ---------------------------|
* | |
* | present ? |
* | or "*" |
* \/ \/
* return false return true
* SKIP VERIFICATION VERIFY ASSEMBLY
*/
internal class StrongNameManager {
private class Element {
internal Hashtable assemblies;
public Element ()
{
assemblies = new Hashtable ();
}
public Element (string assembly, string users) : this ()
{
assemblies.Add (assembly, users);
}
public string GetUsers (string assembly)
{
return (string) assemblies [assembly];
}
}
static private Hashtable mappings;
static private Hashtable tokens;
static StrongNameManager ()
{
}
// note: more than one configuration file can be loaded at the
// same time (e.g. user specific and machine specific config).
static public void LoadConfig (string filename)
{
if (File.Exists (filename)) {
SecurityParser sp = new SecurityParser ();
using (StreamReader sr = new StreamReader (filename)) {
string xml = sr.ReadToEnd ();
sp.LoadXml (xml);
}
SecurityElement root = sp.ToXml ();
if ((root != null) && (root.Tag == "configuration")) {
SecurityElement strongnames = root.SearchForChildByTag ("strongNames");
if ((strongnames != null) && (strongnames.Children.Count > 0)) {
SecurityElement mapping = strongnames.SearchForChildByTag ("pubTokenMapping");
if ((mapping != null) && (mapping.Children.Count > 0)) {
LoadMapping (mapping);
}
SecurityElement settings = strongnames.SearchForChildByTag ("verificationSettings");
if ((settings != null) && (settings.Children.Count > 0)) {
LoadVerificationSettings (settings);
}
}
}
}
}
static private void LoadMapping (SecurityElement mapping)
{
if (mappings == null) {
mappings = new Hashtable ();
}
lock (mappings.SyncRoot) {
foreach (SecurityElement item in mapping.Children) {
if (item.Tag != "map")
continue;
string token = item.Attribute ("Token");
if ((token == null) || (token.Length != 16))
continue; // invalid entry
token = token.ToUpper (CultureInfo.InvariantCulture);
string publicKey = item.Attribute ("PublicKey");
if (publicKey == null)
continue; // invalid entry
// watch for duplicate entries
if (mappings [token] == null) {
mappings.Add (token, publicKey);
}
else {
// replace existing mapping
mappings [token] = publicKey;
}
}
}
}
static private void LoadVerificationSettings (SecurityElement settings)
{
if (tokens == null) {
tokens = new Hashtable ();
}
lock (tokens.SyncRoot) {
foreach (SecurityElement item in settings.Children) {
if (item.Tag != "skip")
continue;
string token = item.Attribute ("Token");
if (token == null)
continue; // bad entry
token = token.ToUpper (CultureInfo.InvariantCulture);
string assembly = item.Attribute ("Assembly");
if (assembly == null)
assembly = "*";
string users = item.Attribute ("Users");
if (users == null)
users = "*";
Element el = (Element) tokens [token];
if (el == null) {
// new token
el = new Element (assembly, users);
tokens.Add (token, el);
continue;
}
// existing token
string a = (string) el.assemblies [assembly];
if (a == null) {
// new assembly
el.assemblies.Add (assembly, users);
continue;
}
// existing assembly
if (users == "*") {
// all users (drop current users)
el.assemblies [assembly] = "*";
continue;
}
// new users, add to existing
string existing = (string) el.assemblies [assembly];
string newusers = String.Concat (existing, ",", users);
el.assemblies [assembly] = newusers;
}
}
}
static public byte[] GetMappedPublicKey (byte[] token)
{
if ((mappings == null) || (token == null))
return null;
string t = CryptoConvert.ToHex (token);
string pk = (string) mappings [t];
if (pk == null)
return null;
return CryptoConvert.FromHex (pk);
}
// it is possible to skip verification for assemblies
// or a strongname public key using the "sn" tool.
// note: only the runtime checks if the assembly is loaded
// from the GAC to skip verification
static public bool MustVerify (AssemblyName an)
{
if ((an == null) || (tokens == null))
return true;
string token = CryptoConvert.ToHex (an.GetPublicKeyToken ());
Element el = (Element) tokens [token];
if (el != null) {
// look for this specific assembly first
string users = el.GetUsers (an.Name);
if (users == null) {
// nothing for the specific assembly
// so look for "*" assembly
users = el.GetUsers ("*");
}
if (users != null) {
// applicable to any user ?
if (users == "*")
return false;
// applicable to the current user ?
return (users.IndexOf (Environment.UserName) < 0);
}
}
// we must check verify the strongname on the assembly
return true;
}
public override string ToString ()
{
StringBuilder sb = new StringBuilder ();
sb.Append ("Public Key Token\tAssemblies\t\tUsers");
sb.Append (Environment.NewLine);
if (tokens == null) {
sb.Append ("none");
return sb.ToString ();
}
foreach (DictionaryEntry token in tokens) {
sb.Append ((string)token.Key);
Element t = (Element) token.Value;
bool first = true;
foreach (DictionaryEntry assembly in t.assemblies) {
if (first) {
sb.Append ("\t");
first = false;
}
else {
sb.Append ("\t\t\t");
}
sb.Append ((string)assembly.Key);
sb.Append ("\t");
string users = (string)assembly.Value;
if (users == "*")
users = "All users";
sb.Append (users);
sb.Append (Environment.NewLine);
}
}
return sb.ToString ();
}
}
}

330
mcs/tools/security/TESTS Normal file
View File

@@ -0,0 +1,330 @@
Mono's Security Tools - TESTS
Last updated: August 17, 2006
-------------------------------------------------------------------------------
* AUTHENTICODE
Here's a short description on how to test any changes in the Authenticode tool
set. This set includes makecert, cert2spc, signcode and chktrust.
This is a _minimal_ sequence. Each input/output could be tested under Linux
and Windows to ensure maximum compatibility.
0. Setup
% cd /mcs/tools/security
% make
% mono setreg.exe 1 TRUE
% cp signcode.exe test.exe
1. Create a test certificate for code-signing
% mono makecert.exe -n "CN=careful tester" -sv test.pvk test.cer
Mono MakeCert - version 1.1.15.0
X.509 Certificate Builder
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
Success
2. Convert the test certificate to the SPC format
% mono cert2spc.exe test.cer test.spc
Mono Cert2Spc - version 1.1.15.0
Transform a set of X.509 certificates and CRLs into an Authenticode(TM) "Software Publisher Certificate"
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
Success
3. Sign a PE binary (without a timestamp)
% mono signcode.exe -v test.pvk -spc test.spc test.exe
Mono SignCode - version 1.1.15.0
Sign assemblies and PE files using Authenticode(tm).
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
Success
4. Verify the binary from step 3
% mono chktrust.exe test.exe
Mono CheckTrust - version 1.1.15.0
Verify if an PE executable has a valid Authenticode(tm) signature
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
WARNING! test.exe is not timestamped!
SUCCESS: test.exe signature is valid
and can be traced back to a trusted root!
*** note the warning about the missing timestamp ***
5. Verify the binary from step 3 using MS tools [1]
a. Using Windows Explorer, right click on the test.exe file and select
the "Properties" menu item;
b. From the "test.exe Properties" windows select the "Digital
Signatures" tab;
c. You should see "careful tester" as the "Name of signer", select it
and click on the "Details" button;
d. Unless you have created your test certificate with MS tools you
should see an error (white X on a red circle) with a description
saying "The certificate in the signature cannot be verified.";
e. You should NOT see any countersignature;
6. Add a timestamp the binary from step 3
% mono signcode.exe -x -t http://timestamp.verisign.com/scripts/timstamp.dll test.exe
Mono SignCode - version 1.1.15.0
Sign assemblies and PE files using Authenticode(tm).
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
Success
7. Verify the binary from step 6
% mono chktrust.exe test.exe
Mono CheckTrust - version 1.1.15.0
Verify if an PE executable has a valid Authenticode(tm) signature
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
SUCCESS: test.exe signature is valid
and can be traced back to a trusted root!
*** note that there is NO warning this time ***
8. Verify the binary from step 6 on Windows [1]
a. Follow step 5 from 'a' to 'd'
b. This time you should see a countersignature;
9. Sign a PE binary with a timestamp
% mono signcode.exe -v test.pvk -spc test.spc -t http://timestamp.verisign.com/scripts/timstamp.dll test.exe
Mono SignCode - version 1.1.15.0
Sign assemblies and PE files using Authenticode(tm).
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
Success
10. Verify the binary from step 9
% mono chktrust.exe test.exe
Mono CheckTrust - version 1.1.15.0
Verify if an PE executable has a valid Authenticode(tm) signature
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
SUCCESS: test.exe signature is valid
and can be traced back to a trusted root!
11. Verify the binary from step 9 on Windows [1]
a. Follow step 5 from 'a' to 'd'
b. This time you should see a countersignature;
12. Add (another) timestamp the binary from step 9
% mono signcode.exe -x -t http://timestamp.verisign.com/scripts/timstamp.dll test.exe
Mono SignCode - version 1.1.15.0
Sign assemblies and PE files using Authenticode(tm).
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
Success
13. Verify the binary from step 12
Mono CheckTrust - version 1.1.15.0
Verify if an PE executable has a valid Authenticode(tm) signature
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2006 Novell. BSD licensed.
SUCCESS: test.exe signature is valid
and can be traced back to a trusted root!
14. Verify the binary from step 12 on Windows [1]
a. Follow step 5 from 'a' to 'd'
b. This time you should see TWO (2) countersignature, the same one as
step 11 and a new one;
15. Clean up
% rm test.*
% mono setreg.exe 1 FALSE
[1] this step must be done on Windows using MS Authenticode(r) tools.
-------------------------------------------------------------------------------
* STRONGNAME
Here's a minimal test sequence for any change in SN source code (or in the
RSA source code). If/when possible all verification should also be done using
the MS runtime and tools to ensure full interoperability.
0. Setup
% cd /mcs/tools/security
% make
% sudo make install
% echo "class Program { static void Main () { System.Console.WriteLine (\"hello world\"); } }" > tmp.cs
% mcs tmp.cs -out:tmp.exe
% sn -v tmp.exe
[...]
tmp.exe is not a strongly named assembly.
1. Create a SNK file (default size is 1024 bits)
% sn -k 1024.snk
[...]
A new 1024 bits strong name keypair has been generated in file '1024.snk'.
% mcs -delaysign+ -keyfile:1024.snk tmp.cs -out:tmp1024.exe
% sn -v tmp1024.exe
[...]
Assembly tmp1024.exe isn't strongnamed
% mcs -keyfile:1024.snk tmp.cs -out:tmp1024.exe
% sn -v tmp1024.exe
[...]
Assembly tmp1024.exe is strongnamed.
2. Create a large SNK file (supported by Fx 2.0 and later)
% sn -k 2048 2048.snk
[...]
A new 2048 bits strong name keypair has been generated in file '2048.snk'.
% mcs -delaysign+ -keyfile:2048.snk tmp.cs -out:tmp2048.exe
% sn -v tmp2048.exe
[...]
Assembly tmp2048.exe isn't strongnamed
% sn -R tmp2048.exe 2048.snk
[...]
Assembly tmp2048.exe signed.
% sn -v tmp2048.exe
[...]
Assembly tmp2048.exe is strongnamed.
3. Create a PFX (PKCS#12) file
% makecert -r -n "CN=mono" -p12 tmp.pfx mono
[...]
Success
% sn -p tmp.pfx tmp.pub
[...]
Enter password for private key (will be visible when typed): mono
Public Key extracted to file tmp.pub
% sn -tp tmp.pub
Public Key:
0024000004800000940000000602000000240000525341310004000011000000137d8a780901ce
3ceeb3aa9c813d9027d96e8be0cae633d0f64e584eb50685adb063b72fe3395f681ffda8a7c940
d0a8c76b1670c3a54cd354af82fe3995f6784a30c14a106d02f4150d0b370479a2cae574f4bce1
bf97a41e59f855a3d0062918861e55afacf9e4934365ea61718ba460dcb46143fee7278414a683
85336ace
Public Key Token: de950f189632e7d9
*** Note: your public won't match this one - but it will identical to
*** the one we'll extract from the EXE in a few steps...
% mcs -delaysign+ -keyfile:tmp.pub tmp.cs -out:tmppfx.exe
% sn -R tmppfx.exe tmp.pfx
[...]
Enter password for private key (will be visible when typed): mono
Assembly tmppfx.exe signed.
% sn -v tmppfx.exe
[...]
Assembly tmppfx.exe is strongnamed.
4. Test using the "well known" files
% sn -tp ../../class/mono.snk
[...]
Public Key:
002400000480000094000000060200000024000052534131000400000100010079159977d2d03a
8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c
3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fd
dafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00
65d016df
Public Key Token: 0738eb9f132ed756
% sn -Tp ../../class/lib/default/Mono.Security.dll
[...]
Public Key:
002400000480000094000000060200000024000052534131000400000100010079159977d2d03a
8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c
3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fd
dafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00
65d016df
Public Key Token: 0738eb9f132ed756
% sn -p ../../class/mono.snk tmp.pub
[...]
Public Key extracted to file tmp.pub
% md5sum tmp.pub
b35461067e0e8e00941d68bd55e38582 tmp.pub
% sn -tp tmp.pub
[...]
Public Key:
002400000480000094000000060200000024000052534131000400000100010079159977d2d03a
8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c
3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fd
dafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef00
65d016df
Public Key Token: 0738eb9f132ed756
5. Cleanup
% rm tmp*.*
-------------------------------------------------------------------------------
Send any bug or suggestions to sebastien at ximian.com

1115
mcs/tools/security/caspol.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,106 @@
//
// Cert2Spc.cs: cert2spc clone tool
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
// (C) 2004 Novell (http://www.novell.com)
//
using System;
using System.IO;
using System.Reflection;
using Mono.Security.Authenticode;
using Mono.Security.X509;
[assembly: AssemblyTitle("Mono Cert2Spc")]
[assembly: AssemblyDescription("Transform a set of X.509 certificates and CRLs into an Authenticode(TM) \"Software Publisher Certificate\"")]
namespace Mono.Tools {
class Cert2Spc {
static private string error;
static private void Header ()
{
Console.WriteLine (new AssemblyInfo ().ToString ());
}
static private void Help ()
{
Console.WriteLine ("Usage: cert2spc certificate|crl [certificate|crl] [...] outputfile.spc{0}", Environment.NewLine);
}
// until we have real CRL support
static byte[] GetFile (string filename)
{
byte[] data = null;
using (FileStream fs = File.Open (filename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
data = new byte [fs.Length];
fs.Read (data, 0, data.Length);
fs.Close ();
}
return data;
}
static int Process (string[] args)
{
int nargs = args.Length - 1;
if (nargs < 1) {
error = "At least one input and output files must be specified";
return 1;
}
string output = args [nargs];
SoftwarePublisherCertificate spc = new SoftwarePublisherCertificate ();
for (int i=0; i < args.Length - 1; i++) {
switch (Path.GetExtension (args[i]).ToLower ()) {
case ".cer":
case ".crt":
spc.Certificates.Add (new X509Certificate (GetFile (args[i])));
break;
case ".crl":
spc.Crls.Add (GetFile (args[i]));
break;
default:
error = "Unknown file extension : " + args[i];
return 1;
}
}
using (FileStream fs = File.Open (output, FileMode.Create, FileAccess.Write)) {
byte[] data = spc.GetBytes ();
fs.Write (data, 0, data.Length);
fs.Close ();
}
return 0;
}
[STAThread]
static int Main (string[] args)
{
int result = 1;
try {
Header ();
result = Process (args);
if (error == null)
Console.WriteLine ("Success");
else {
Console.WriteLine ("Error: {0}{1}", error, Environment.NewLine);
Help ();
}
}
catch (Exception e) {
Console.WriteLine ("Error: " + e.ToString ());
Help ();
}
return result;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,387 @@
//
// CertificateFormatter.cs: Certificate Formatter (not GUI specific)
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
// (C) 2004 Novell (http://www.novell.com)
//
using System;
using System.Collections;
using System.Configuration;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using Mono.Security.X509;
using Mono.Security.X509.Extensions;
namespace Mono.Tools.CertView {
public class CertificateFormatter {
public class FieldNames {
public FieldNames () {}
public const string Version = "Version";
public const string SerialNumber = "Serial number";
public const string SignatureAlgorithm = "Signature algorithm";
public const string Issuer = "Issuer";
public const string ValidFrom = "Valid from";
public const string ValidUntil = "Valid until";
public const string Subject = "Subject";
public const string PublicKey = "Public key";
}
public class PropertyNames {
public PropertyNames () {}
public const string ThumbprintAlgorithm = "Thumbprint algorithm";
public const string Thumbprint = "Thumbprint";
}
public class Help {
public Help () {}
public const string IssuedBy = "This is the distinguished name (DN) of the certificate authority (CA) that issued this certificate.";
public const string IssuedTo = "This is the distinguished name (DN) of the entity (individual, device or organization) to whom the certificate was issued.";
public const string ValidFrom = "This certificate isn't valid before the specified date.";
public const string ValidUntil = "This certificate isn't valid after the specified date. This also means that the certificate authority (CA) won't publish the status of the certificate after this date.";
}
private const string untrustedRoot = "This root certificate isn't part of your trusted root store. Please read your documentation carefully before adding a new root certificate in your trusted store.";
private const string unknownCriticalExtension = "This certificate contains unknown critical extensions and shouldn't be used by applications that can't process those extensions.";
private const string noSignatureCheck = "The signature of the certificate can;t be verified without the issuer certificate.";
private const string noValidation = "No CRL, nor an OCSP responder, has been found to validate the status of the certificate.";
private const string unsupportedHash = "The {0} algorithm is unsupported by the .NET Framework. The certificate signature cannot be verified.";
private string thumbprintAlgorithm;
private X509Certificate x509;
private string status;
private string[] subjectAltName;
private static string defaultThumbprintAlgo;
private static Hashtable extensions;
static CertificateFormatter ()
{
IDictionary tb = (IDictionary) ConfigurationSettings.GetConfig ("Thumbprint");
defaultThumbprintAlgo = ((tb != null) ? (string) tb ["Algorithm"] : "SHA1");
extensions = new Hashtable ();
IDictionary exts = (IDictionary) ConfigurationSettings.GetConfig ("X509.Extensions");
if (exts != null) {
foreach (DictionaryEntry ext in exts)
extensions.Add (ext.Key, ext.Value);
}
}
private X509Extension CreateExtensionFromOid (string oid, object[] args)
{
try {
Type algoClass = null;
string algo = (string) extensions [oid];
// do we have an entry
if (algo == null)
return (X509Extension) args [0];
algoClass = Type.GetType (algo);
// call the constructor for the type
return (X509Extension) Activator.CreateInstance (algoClass, args);
}
catch {
// method doesn't throw any exception
return (X509Extension) args [0];
}
}
public CertificateFormatter (string filename)
{
byte[] data = null;
using (FileStream fs = File.Open (filename, FileMode.Open, FileAccess.Read, FileShare.Read)) {
data = new byte [fs.Length];
fs.Read (data, 0, data.Length);
fs.Close ();
}
if ((data != null) && (data.Length > 0)) {
X509Certificate x509 = null;
if (data [0] != 0x30) {
// it may be PEM encoded
data = FromPEM (data);
}
if (data [0] == 0x30) {
x509 = new X509Certificate (data);
if (x509 != null) {
Initialize (x509);
}
}
}
}
private byte[] FromPEM (byte[] data)
{
string pem = Encoding.ASCII.GetString (data);
int start = pem.IndexOf ("-----BEGIN CERTIFICATE-----");
if (start < 0)
return null;
start += 27; // 27 being the -----BEGIN CERTIFICATE----- length
int end = pem.IndexOf ("-----END CERTIFICATE-----", start);
if (end < start)
return null;
string base64 = pem.Substring (start, (end - start));
return Convert.FromBase64String (base64);
}
public CertificateFormatter (X509Certificate cert)
{
Initialize (cert);
}
internal void Initialize (X509Certificate cert)
{
x509 = cert;
thumbprintAlgorithm = defaultThumbprintAlgo;
try {
// preprocess some informations
foreach (X509Extension xe in x509.Extensions) {
if ((!extensions.ContainsKey (xe.Oid)) && (xe.Critical))
status = unknownCriticalExtension;
if (xe.Oid == "2.5.29.17") {
SubjectAltNameExtension san = new SubjectAltNameExtension (xe);
subjectAltName = san.RFC822;
}
}
if (x509.IsSelfSigned) {
status = untrustedRoot;
}
}
catch (Exception e) {
status = e.ToString ();
}
}
public X509Certificate Certificate {
get { return x509; }
}
public string Status {
get { return status; }
}
public X509Extension GetExtension (int i)
{
X509Extension xe = x509.Extensions [i];
object[] extn = new object [1] { xe };
return CreateExtensionFromOid (xe.Oid, extn);
}
public string Extension (int i, bool detailed)
{
X509Extension xe = x509.Extensions [i];
if (!detailed)
return Array2Word (xe.Value.Value);
return Extension2String (x509.Extensions[i].Value.Value);
}
private string DN (string dname, bool detailed)
{
string[] a = dname.Split (',');
StringBuilder sb = new StringBuilder ();
if (detailed) {
foreach (string s in a) {
string s2 = s.Trim () + Environment.NewLine;
sb.Insert (0, s2.Replace ("=", " = "));
}
}
else {
foreach (string s in a) {
string s2 = s.Trim ();
sb.Insert (0, s2.Substring (s2.IndexOf ("=") + 1) + ", ");
}
// must remove last ", "
sb.Remove (sb.Length - 2, 2);
}
return sb.ToString();
}
public string Issuer (bool detailed)
{
return DN (x509.IssuerName, detailed);
}
public string PublicKey (bool detailed)
{
if (detailed)
return Array2Word (x509.PublicKey);
if (x509.RSA != null)
return "RSA (" + x509.RSA.KeySize + " Bits)";
else if (x509.DSA != null)
return "DSA (" + x509.DSA.KeySize + " Bits)";
return "Unknown key type (unknown key size)";
}
public string SerialNumber (bool detailed)
{
byte[] sn = (byte[]) x509.SerialNumber.Clone ();
Array.Reverse (sn);
return CertificateFormatter.Array2Word (sn);
}
public string Subject (bool detailed)
{
return DN (x509.SubjectName, detailed);
}
public string SubjectAltName (bool detailed)
{
if ((subjectAltName == null) || (subjectAltName.Length < 1))
return String.Empty;
if (!detailed)
return "mailto:" + subjectAltName [0];
StringBuilder sb = new StringBuilder ();
foreach (string s in subjectAltName) {
sb.Append (s);
sb.Append (Environment.NewLine);
}
return sb.ToString ();
}
public string SignatureAlgorithm (bool detailed)
{
string result = null;
switch (x509.SignatureAlgorithm) {
case "1.2.840.10040.4.3":
result = "sha1DSA";
break;
case "1.2.840.113549.1.1.2":
result = "md2RSA";
status = String.Format (unsupportedHash, "MD2");
break;
case "1.2.840.113549.1.1.3":
result = "md4RSA";
status = String.Format (unsupportedHash, "MD4");
break;
case "1.2.840.113549.1.1.4":
result = "md5RSA";
break;
case "1.2.840.113549.1.1.5":
result = "sha1RSA";
break;
case "1.3.14.3.2.29":
result = "sha1WithRSASignature";
break;
default:
result = x509.SignatureAlgorithm;
if (detailed)
return "unknown (" + result + ")";
return result;
}
if (detailed)
result += " (" + x509.SignatureAlgorithm + ")";
return result;
}
public string ThumbprintAlgorithm {
get { return thumbprintAlgorithm.ToLower (); }
set { thumbprintAlgorithm = value; }
}
public byte[] Thumbprint {
get {
HashAlgorithm ha = HashAlgorithm.Create (thumbprintAlgorithm);
return ha.ComputeHash (x509.RawData);
}
}
public string ValidFrom (bool detailed)
{
return x509.ValidFrom.ToString ();
}
public string ValidUntil (bool detailed)
{
return x509.ValidUntil.ToString ();
}
public string Version (bool detailed)
{
return "V" + x509.Version;
}
static public string OneLine (string input)
{
// remove tabulation
string oneline = input.Replace ("\t", "");
// remove new lines after :
oneline = oneline.Replace (":" + Environment.NewLine, ":");
// remove ending new line (if present)
if (oneline.EndsWith (Environment.NewLine))
oneline = oneline.Substring (0, oneline.Length - Environment.NewLine.Length);
// replace remaining new lines by comma + space
return oneline.Replace (Environment.NewLine, ", ");
}
static public string Array2Word (byte[] array)
{
StringBuilder sb = new StringBuilder ();
int x = 0;
while (x < array.Length) {
sb.Append (array [x].ToString ("X2"));
if (x % 2 == 1)
sb.Append (" ");
x++;
}
return sb.ToString ();
}
static private void WriteLine (StringBuilder sb, byte[] extnValue, int n, int pos)
{
int p = pos;
StringBuilder preview = new StringBuilder ();
for (int j=0; j < 8; j++) {
if (j < n) {
sb.Append (extnValue [p++].ToString ("X2"));
sb.Append (" ");
}
else
sb.Append (" ");
}
sb.Append (" ");
p = pos;
for (int j=0; j < n; j++) {
byte b = extnValue [p++];
if (b < 0x20)
sb.Append (".");
else
sb.Append (Convert.ToChar (b));
}
sb.Append (Environment.NewLine);
}
static public string Extension2String (byte[] extnValue)
{
StringBuilder sb = new StringBuilder ();
int div = (extnValue.Length >> 3);
int rem = (extnValue.Length - (div << 3));
int x = 0;
for (int i=0; i < div; i++) {
WriteLine (sb, extnValue, 8, x);
x += 8;
}
WriteLine (sb, extnValue, rem, x);
return sb.ToString ();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
2005-09-05 Sebastien Pouliot <sebastien@ximian.com>
* certview.glade: Removed filenames for bitmaps.
* gcertview.cs: Fix compilation. Use resources not files for UI stuff.
* CertificateFormatter.cs: Fix compilation.
* Makefile: Build Gtk# version using resources. Minor fixes.
* TODO: All future development will occur in mono-tools.
2004-03-21 Sebastien Pouliot <sebastien@ximian.com>
* ChangeLog: commited missing ChangeLog entries.
2004-03-10 Sebastien Pouliot <sebastien@ximian.com>
* CertificateFormatter.cs: Support PEM (base64) certificates. Removed
temporary comments for MCS bug.
* certview.exe.config: Added KeyAttributesExtension extension.
* gcertview.cs: Updated to work with latest Gtk#.
* gcertview.exe.config: Added KeyAttributesExtension extension.
* Makefile: Re-added the /win32icon:mono.ico (now supported by mcs).
* TODO: New. Incomplete TODO for X.509 GUI tools
2003-06-15 Sebastien Pouliot <spouliot@videotron.ca>
* .cvsignore: Ignore generated files (remove with make clean).
* CertificateFormatter.cs: Commented 2 lines as it didn't compile
with MCS (but did compile with CSC).
* gcertview.cs: Change app.ico (non-existing) to mono.bmp (16x16).
* gcertview.exe.config: New. Configuration file for gcertview (same
as certview.exe.config except it reference gcertview.exe instead of
certview.exe).
* makefile: Updated for linux by Ben Maurer.
2003-06-14 Sebastien Pouliot <spouliot@videotron.ca>
* CertificateViewer.cs: New. SFW-based certificate viewer.
* CertificateViewer.resx: New. SWF Resource file.
* CertificateFormatter.cs: New. Not GUI specific.
* certview.exe.config: New. Configuration file for certview.
* certview.glade: New. GUI for GTK#.
* certview.gladep: New. Project file for GLADE.
* gcertview.cs: New. GTK#-based certificate viewer.
* makefile: New. makefile for both SWF and GTK# viewers.
* mono.bmp: New. 16x16 bitmap for Mono::
* mono.ico: New. 32x32 windows icon for Mono::
* v1.bmp: New. 16x16 bitmap for X.509 v1 properties/extensions.
* v2.bmp: New. 16x16 bitmap for X.509 v2 properties/extensions.
* v3.bmp: New. 16x16 bitmap for X.509 v3 properties/extensions.
* v3critical.bmp: New. 16x16 bitmap for X.509 v3 critical extensions.
* wax-seal.png: New. Bitmap for valid certificate.
* wax-seal-broken.png: Bitmap for invalid certificate.
* X509ExtensionsHandler.cs: Configuration file parser.

View File

@@ -0,0 +1,53 @@
thisdir = tools/security/certview
SUBDIRS =
include ../../../build/rules.make
RESGEN = resgen
LOCAL_MCS_FLAGS = /lib:$(topdir)/class/lib /r:Mono.Security.dll /r:System.Xml.dll /win32icon:mono.ico
# SWF isn't quite good enough to build this yet.
all-local: certview.exe
install-local:
$(MKINSTALLDIRS) $(DESTDIR)$(prefix)/bin
$(INSTALL_BIN) certview.exe $(DESTDIR)$(prefix)/bin
clean-local:
rm -f *.exe *.resources
test-local run-test-local:
DISTFILES = \
CertificateViewer.cs \
CertificateFormatter.cs \
X509ExtensionsHandler.cs \
certview.exe.config \
certview.glade \
certview.gladep \
gcertview.cs \
gcertview.exe.config \
mono.ico \
$(resources)
resources = $(wildcard *.bmp) \
$(wildcard *.png)
dist-local: dist-default
sources = CertificateViewer.cs CertificateFormatter.cs X509ExtensionsHandler.cs ../AssemblyInfo.cs ../../../build/common/Consts.cs
cv_libs = /r:System.Windows.Forms.dll /r:System.Drawing.dll
gcv_libs = -pkg:gtk-sharp -pkg:glade-sharp
certview.exe: $(sources) Mono.Tools.CertView.CertificateViewer.resources
$(CSCOMPILE) $(cv_libs) -resource:Mono.Tools.CertView.CertificateViewer.resources $(sources)
# We can't make this by default since it relies on GTK#
ress= $(foreach res,$(resources), $(addprefix -resource:,$(res)),$(notdir $(res)))
gcertview.exe: gcertview.cs CertificateFormatter.cs X509ExtensionsHandler.cs ../AssemblyInfo.cs ../../../build/common/Consts.cs
$(CSCOMPILE) $(gcv_libs) $^ -resource:certview.glade $(ress)
Mono.Tools.CertView.CertificateViewer.resources: CertificateViewer.resx
$(RESGEN) $^ $@

View File

@@ -0,0 +1,37 @@
//
// ExtensionsHandler.cs: Extensions Configuration Handler (not GUI specific)
//
// Author:
// Sebastien Pouliot (spouliot@motus.com)
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
//
using System;
using System.Collections;
using System.Configuration;
using System.Xml;
namespace Mono.Tools.CertView {
public class X509ExtensionsHandler : DictionarySectionHandler {
public X509ExtensionsHandler () : base () {}
public override object Create (object parent, object context, XmlNode section)
{
XmlNodeList xnl = section.SelectNodes ("/X509.Extensions/Extension");
if (xnl == null)
return null;
Hashtable ht = new Hashtable ();
foreach (XmlNode xn in xnl) {
XmlAttribute xaOid = xn.Attributes ["OID"];
XmlAttribute xaClass = xn.Attributes ["Class"];
if ((xaOid != null) && (xaClass != null))
ht.Add (xaOid.InnerText, xaClass.InnerText);
}
return ht;
}
}
}

View File

@@ -0,0 +1,22 @@
<configuration>
<configSections>
<section name="Thumbprint" type="System.Configuration.SingleTagSectionHandler" />
<section name="X509.Extensions" type="Mono.Tools.CertView.X509ExtensionsHandler, certview, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<Thumbprint Algorithm="SHA1" />
<X509.Extensions>
<Extension OID="2.5.29.2" Class="Mono.Security.X509.Extensions.KeyAttributesExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.14" Class="Mono.Security.X509.Extensions.SubjectKeyIdentifierExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.15" Class="Mono.Security.X509.Extensions.KeyUsageExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.16" Class="Mono.Security.X509.Extensions.PrivateKeyUsagePeriodExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.17" Class="Mono.Security.X509.Extensions.SubjectAltNameExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.19" Class="Mono.Security.X509.Extensions.BasicConstraintsExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.31" Class="Mono.Security.X509.Extensions.CRLDistributionPointsExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.32" Class="Mono.Security.X509.Extensions.CertificatePoliciesExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.35" Class="Mono.Security.X509.Extensions.AuthorityKeyIdentifierExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.37" Class="Mono.Security.X509.Extensions.ExtendedKeyUsageExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.16.840.1.113730.1.1" Class="Mono.Security.X509.Extensions.NetscapeCertTypeExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
</X509.Extensions>
</configuration>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
<glade-project>
<name>certview</name>
<program_name>certview</program_name>
</glade-project>

View File

@@ -0,0 +1,294 @@
//
// gcertview.cs: GTK# Certificate Viewer
//
// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
// (C) 2004 Novell (http://www.novell.com)
//
using System;
using System.IO;
using System.Reflection;
using Mono.Security.X509;
using Gdk;
using Gtk;
using Glade;
using GLib;
using GtkSharp;
[assembly: AssemblyTitle("Mono Certificate Viewer")]
[assembly: AssemblyDescription("X.509 Certificate Viewer for GTK#")]
namespace Mono.Tools.CertView {
public class GtkCertificateViewer {
static private void Header ()
{
Assembly a = Assembly.GetExecutingAssembly ();
AssemblyName an = a.GetName ();
object [] att = a.GetCustomAttributes (typeof (AssemblyTitleAttribute), false);
string title = ((att.Length > 0) ? ((AssemblyTitleAttribute) att [0]).Title : "Mono Certificate Viewer");
att = a.GetCustomAttributes (typeof (AssemblyCopyrightAttribute), false);
string copyright = ((att.Length > 0) ? ((AssemblyCopyrightAttribute) att [0]).Copyright : "");
Console.WriteLine ("{0} {1}", title, an.Version.ToString ());
Console.WriteLine ("{0}{1}", copyright, Environment.NewLine);
}
public static void Main (string[] args)
{
string filename = ((args.Length > 0) ? args[0] : null);
if ((filename != null) && (File.Exists (filename)))
new GtkCertificateViewer (filename);
else {
Header ();
Console.WriteLine ("Usage: mono gcertview.exe certificate.cer");
}
}
[Glade.Widget] Button issuerStatementButton;
[Glade.Widget] Gtk.Image brokenSealImage;
[Glade.Widget] Gtk.Image sealImage;
[Glade.Widget] Entry issuedToEntry;
[Glade.Widget] Entry issuedByEntry;
[Glade.Widget] Label subjectAltNameLabel;
[Glade.Widget] TextView certInfoTextview;
[Glade.Widget] TextView certStatusTextview;
[Glade.Widget] Entry notBeforeEntry;
[Glade.Widget] Entry notAfterEntry;
[Glade.Widget] TreeView detailsTreeview;
[Glade.Widget] TextView detailsTextview;
[Glade.Widget] Entry showComboEntry;
// non widget stuff
private static Pixbuf[] version;
private static TreeCellDataFunc dataFunc = null;
private ListStore allStore;
private ListStore v1Store;
private ListStore extensionsStore;
private ListStore criticalStore;
private ListStore propertiesStore;
private ListStore emptyStore;
// non-glade stuff
private CertificateFormatter cf;
public GtkCertificateViewer (string filename)
{
Application.Init();
Glade.XML gxml = new Glade.XML (null, "certview.glade", "CertificateViewer", null);
gxml.Autoconnect (this);
cf = new CertificateFormatter (filename);
// init UI
brokenSealImage.Pixbuf = new Pixbuf (null, "wax-seal-broken.png");
sealImage.Pixbuf = new Pixbuf (null, "wax-seal.png");
Tooltips tt = new Tooltips ();
issuedToEntry.Text = cf.Issuer (false);
tt.SetTip (issuedToEntry, issuedToEntry.Text, issuedToEntry.Text);
issuedByEntry.Text = cf.Subject (false);
tt.SetTip (issuedByEntry, issuedByEntry.Text, issuedByEntry.Text);
subjectAltNameLabel.Text = cf.SubjectAltName (false);
subjectAltNameLabel.Visible = (subjectAltNameLabel.Text != null);
notBeforeEntry.Text = cf.Certificate.ValidFrom.ToString ("yyyy-MM-dd");
notAfterEntry.Text = cf.Certificate.ValidUntil.ToString ("yyyy-MM-dd");
TextBuffer tb = new TextBuffer (null);
if (cf.Status != null)
tb.SetText (cf.Status);
certStatusTextview.Buffer = tb;
if (cf.Status != null) {
certInfoTextview.Buffer = tb;
certInfoTextview.ModifyText (StateType.Normal, new Gdk.Color (0xff, 0x00, 0x00));
}
sealImage.Visible = (cf.Status == null);
brokenSealImage.Visible = !sealImage.Visible;
Type[] storeType = new Type [4] { typeof (string), typeof (string), typeof (string), typeof (int) };
allStore = new ListStore (storeType);
v1Store = new ListStore (storeType);
extensionsStore = new ListStore (storeType);
criticalStore = new ListStore (storeType);
propertiesStore = new ListStore (storeType);
emptyStore = new ListStore (storeType);
AddToStores (CertificateFormatter.FieldNames.Version, cf.Version (false), cf.Version (true), 1);
AddToStores (CertificateFormatter.FieldNames.SerialNumber, cf.SerialNumber (false), cf.SerialNumber (true), 0);
AddToStores (CertificateFormatter.FieldNames.SignatureAlgorithm, cf.SignatureAlgorithm (false), cf.SignatureAlgorithm (true), 0);
AddToStores (CertificateFormatter.FieldNames.Issuer, cf.Issuer (false), cf.Issuer (true), 0);
AddToStores (CertificateFormatter.FieldNames.ValidFrom, cf.ValidFrom (false), cf.ValidFrom (true), 0);
AddToStores (CertificateFormatter.FieldNames.ValidUntil, cf.ValidUntil (false), cf.ValidUntil (true), 0);
AddToStores (CertificateFormatter.FieldNames.Subject, cf.Subject (false), cf.Subject (true), 0);
AddToStores (CertificateFormatter.FieldNames.PublicKey, cf.PublicKey (false), cf.PublicKey (true), 0);
for (int i=0; i < cf.Certificate.Extensions.Count; i++) {
X509Extension xe = cf.GetExtension (i);
string name = xe.Name;
int icon = 2;
if (xe.Critical)
icon = 3;
string exts = xe.ToString ();
string details;
if (xe.Name == xe.Oid) {
exts = cf.Extension (i, false);
details = cf.Extension (i, true);
}
else {
details = xe.ToString ();
exts = CertificateFormatter.OneLine (details);
}
AddToStores (name, exts, details, icon);
}
AddToStores (CertificateFormatter.PropertyNames.ThumbprintAlgorithm, cf.ThumbprintAlgorithm, cf.ThumbprintAlgorithm, 4);
string ftb = CertificateFormatter.Array2Word (cf.Thumbprint);
AddToStores (CertificateFormatter.PropertyNames.Thumbprint, ftb, ftb, 4);
// select appropriate store to show
OnShowComboChanged (null, null);
TreeViewColumn fieldColumn = new TreeViewColumn ();
CellRendererPixbuf pr = new CellRendererPixbuf ();
CellRenderer fieldRenderer = new CellRendererText ();
fieldColumn.PackStart (pr, false);
fieldColumn.SetCellDataFunc (pr, CellDataFunc, IntPtr.Zero, null);
fieldColumn.Title = "Field";
fieldColumn.PackStart (fieldRenderer, false);
fieldColumn.AddAttribute (fieldRenderer, "text", 0);
detailsTreeview.AppendColumn (fieldColumn);
TreeViewColumn valueColumn = new TreeViewColumn ();
CellRenderer valueRenderer = new CellRendererText ();
valueColumn.Title = "Value";
valueColumn.PackStart (valueRenderer, true);
valueColumn.AddAttribute (valueRenderer, "text", 1);
detailsTreeview.AppendColumn (valueColumn);
// detailsTreeview.ModifyText (StateType.Selected, new Gdk.Color (0x33, 0xff, 0x33));
Application.Run();
}
static void SetCellData (TreeViewColumn col, CellRenderer cell, TreeModel model, TreeIter iter)
{
int icon = (int) model.GetValue (iter, 3);
CellRendererPixbuf cr = (CellRendererPixbuf) cell;
cr.Pixbuf = version [icon];
}
public static Gtk.TreeCellDataFunc CellDataFunc {
get {
if (dataFunc == null) {
dataFunc = new TreeCellDataFunc (SetCellData);
version = new Pixbuf [5];
version [0] = new Pixbuf (null, "v1.bmp");
version [1] = new Pixbuf (null, "v2.bmp");
version [2] = new Pixbuf (null, "v3.bmp");
version [3] = new Pixbuf (null, "v3critical.bmp");
version [4] = new Pixbuf (null, "mono.bmp");
}
return dataFunc;
}
}
private void AddToStores (string fieldName, string fieldValue, string detailedValue, int iconValue)
{
GLib.Value fv = new GLib.Value (fieldName);
GLib.Value vv = new GLib.Value (fieldValue);
GLib.Value dv = new GLib.Value (detailedValue);
GLib.Value iv = new GLib.Value (iconValue);
switch (iconValue) {
case 0: // X.509 version 1 fields
AddToStore (v1Store, fv, vv, dv, iv);
break;
case 2: // extensions
AddToStore (extensionsStore, fv, vv, dv, iv);
break;
case 3: // critical extensions
AddToStore (extensionsStore, fv, vv, dv, iv);
AddToStore (criticalStore, fv, vv, dv, iv);
break;
case 4: // properties
AddToStore (propertiesStore, fv, vv, dv, iv);
break;
}
// and we always add to allStore
AddToStore (allStore, fv, vv, dv, iv);
}
private void AddToStore (ListStore store, GLib.Value field, GLib.Value value, GLib.Value details, GLib.Value icon)
{
TreeIter iter = store.Append ();
store.SetValue (iter, 0, field);
store.SetValue (iter, 1, value);
store.SetValue (iter, 2, details);
store.SetValue (iter, 3, icon);
}
private void OnCursorChanged (object o, EventArgs args)
{
TreeModel model;
TreeIter iter = new TreeIter ();
TreeSelection ts = detailsTreeview.Selection;
ts.GetSelected (out model, out iter);
TextBuffer tb = new TextBuffer (null);
tb.SetText ((string) detailsTreeview.Model.GetValue (iter, 2));
detailsTextview.Buffer = tb;
}
private void OnShowComboChanged (object o, EventArgs e)
{
// FIXME: yuck - how can I get an index ?
switch (showComboEntry.Text) {
case "<All>":
detailsTreeview.Model = allStore;
break;
case "Version 1 Fields Only":
detailsTreeview.Model = v1Store;
break;
case "Extensions Only":
detailsTreeview.Model = extensionsStore;
break;
case "Critical Extensions Only":
detailsTreeview.Model = criticalStore;
break;
case "Properties Only":
detailsTreeview.Model = propertiesStore;
break;
default:
detailsTreeview.Model = emptyStore;
break;
}
}
public void OnWindowDeleteEvent (object o, DeleteEventArgs args)
{
Application.Quit ();
args.RetVal = true;
}
public void OnOkButtonClicked (object o, EventArgs e)
{
Application.Quit ();
}
public void OnIssuerStatementButtonClicked (object o, EventArgs e)
{
// TODO
}
}
}

View File

@@ -0,0 +1,22 @@
<configuration>
<configSections>
<section name="Thumbprint" type="System.Configuration.SingleTagSectionHandler" />
<section name="X509.Extensions" type="Mono.Tools.CertView.X509ExtensionsHandler, gcertview, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
</configSections>
<Thumbprint Algorithm="SHA1" />
<X509.Extensions>
<Extension OID="2.5.29.2" Class="Mono.Security.X509.Extensions.KeyAttributesExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.14" Class="Mono.Security.X509.Extensions.SubjectKeyIdentifierExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.15" Class="Mono.Security.X509.Extensions.KeyUsageExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.16" Class="Mono.Security.X509.Extensions.PrivateKeyUsagePeriodExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.17" Class="Mono.Security.X509.Extensions.SubjectAltNameExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.19" Class="Mono.Security.X509.Extensions.BasicConstraintsExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.31" Class="Mono.Security.X509.Extensions.CRLDistributionPointsExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.32" Class="Mono.Security.X509.Extensions.CertificatePoliciesExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.35" Class="Mono.Security.X509.Extensions.AuthorityKeyIdentifierExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.5.29.37" Class="Mono.Security.X509.Extensions.ExtendedKeyUsageExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Extension OID="2.16.840.1.113730.1.1" Class="Mono.Security.X509.Extensions.NetscapeCertTypeExtension, Mono.Security, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" />
</X509.Extensions>
</configuration>

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Some files were not shown because too many files have changed in this diff Show More