3 In the .NET framework cryptography can be found under a number of
4 namespaces in several assemblies. Mono also has it's own assemblies
5 to provide missing security functionalities from the .NET framework.
9 *** Namespace: <b>System.Security.Cryptography</b>
11 Thanks to the work of many people this namespace is almost complete.
15 * All classes are present. Most of them have (minimal)
16 documentation in <b>monodoc</b>.
18 * Most classes have their unit tests. Some tests like <code>
19 SymmetricAlgorithmTest</code> are generated by external
23 *** Namespace: <b>System.Security.Cryptography.X509Certificates</b>
27 * X.509 certificates are parsed using 100% managed code
28 (using the Mono.Security.ASN1 class).
30 * Software Publisher Certificates (SPC) used by Authenticode
31 (tm) to sign assemblies are supported and <b>minimally</b>
34 * Unit tests are generated from a set of existing certificates
35 (about a dozen) each having different properties. Another
36 set of certificates (more than 700) are used for a more
37 complete test (but isn't part of the standard test suite for
38 size and time consideration, i.e. a 7.5Mb C# source file).
43 * The class Mono.Security.X509.X509Certificate (in Mono.Security
44 assembly) is becoming a much better alternative - and will
45 continue to evolve to support the security tools.
49 ** Assembly: System.Security
51 *** Namespace: <b>System.Security.Cryptography.Xml</b>
53 This namespace implements the <a href="http://www.w3.org/TR/xmldsig-core/">
54 XML Digital Signature</a> specification from
55 <a href="http://www.w3.org/">W3C</a>.
59 * We pass the fifteen tests from Merlin's xmldsig suite with
60 success. Which is funny because Microsoft fails in one case
61 where both a X509Certificate and an X509CRL are present in
62 an X509Data. We also pass most Phaos tests.
64 * Most classes have their unit tests. Some standalone tests
65 are also in CVS to test C14N and both Merlin and Phaos test
70 ** Assembly: Mono.Security
73 This assembly provides the missing pieces to .NET security. On Windows
74 CryptoAPI is often used to provide much needed functionalities (like
75 some cryptographic algorithms, code signing, X.509 certificates). Mono,
76 for platform independance, implements these functionalities in 100%
79 *** Namespace: Mono.Security
81 * Structures (ASN1, PKCS7) and primitives (PKCS1).
83 *** Namespace: Mono.Security.Authenticode
85 * Code signing and verification.
86 * Support for SPC (Software Publisher Certificate) files and
87 PVK (Private Key) files.
89 *** Namespace: Mono.Security.Cryptography
91 * Additional algorithms: MD2, MD4, ARCFOUR (required for SSL)
94 *** Namespace: Mono.Security.Protocol.*
96 * Tls: An 100% managed SSLv3 and TLSv1 implementation from
97 Carlos Guzman Alvarez.
98 * Ntlm: NTLM authentication (used for HTTP and SQL Server).
100 *** Namespace: Mono.Security.X509.*
102 * X.509 structures (certificate, CRL...) building and decoding.
103 * PKCS#12 decoding and encoding.
104 * X.509 extensions (from public X.509 to private PKIX, Netsapce,
105 Microsoft, Entrust...).
110 * A big part of this assembly is also included inside Mono's
111 corlib. The classes are duplicated in this assembly so the
112 functionalities can be used without a dependency on Mono's
113 corlib (which depends on Mono's runtime).
115 * Unit test coverage isn't (yet) complete.
117 * Most classes have minimal documentation available in
122 ** Assembly: Mono.Security.Win32
125 This assembly goal is to provide maximum compatibility with CryptoAPI
126 to application running with Mono's runtime on the Windows operating
129 <b>This assembly should NEVER be used directly by any application</b>
130 (e.g. referecing the assembly from a project).
131 The classes should only be used by modifying the <code>machine.config
132 </code> configuration file (and then only if this increased
133 compatibility is required by an application).
135 See the file <code><a href="http://cvs.hispalinux.es/cgi-bin/cvsweb/~checkout~/mcs/class/Mono.Security.Win32/README?rev=1.1&content-type=text/plain&cvsroot=mono">/mcs/class/Mono.Security.Win32/README</a></code>
136 for complete instructions.
138 *** Namespace: Mono.Security.Cryptography
142 * A RNGCryptoServiceProvider built on top of CryptoAPI.
144 * Wrapper classes for unmanaged versions of hash algorithms:
145 MD2, MD4, MD5 and SHA1 are supported. <b>note</b>: some
146 algorithms shouldn't be used in new design (MD4 is broken,
147 MD2 and MD5 aren't considered safe for some usage). They are
148 included to preserve interoperability with older applications
149 (e.g. some old, but still valid, X.509 certificates use MD2,
150 MD4 is required for NTLM authentication ...).
152 * Classes have minimal documentation available in
158 * Wrapper classes for unmanaged versions of symmetric
159 encryption algorithms (like DES, TripleDES, RC2 and others
160 present in default CSP).
162 * Wrapper classes for unmanaged versions of asymmetric
163 algorithms (like DSA and RSA) which persist their keypair
164 into the specified CSP.
169 * Similar assemblies (e.g. <code>Mono.Security.XXX</code>)
170 could be created for <a href="http://www.openssl.org">OpenSSL</a>,
171 <a href="http://www.mozilla.org/projects/security/pki/nss/">NSS</a>,
172 <a href="http://www.eskimo.com/~weidai/cryptlib.html">crypto++</a>,
173 <a href="http://www.cryptlib.orion.co.nz/">cryptlib</a> ... for
174 improved performance and/or HSM (Hardware Security Module) support
175 under Linux and/or Windows.
178 ** Assembly: Microsoft.Web.Services
180 Microsoft Web Service Enhancement (WSE), known as Web Service
181 Development Kit (WSDK) in it's beta days, is an add-on the .NET
182 framework that implements WS-Security (and other WS-* specifications).
183 It also includes improved support for XML Signature (replacing and/or
184 extending <code>System.Security.Cryptography.Xml</code>) and X.509
185 certificates classes.
187 Note: WSE is distributed as an add-on because some specifications,
188 like WS-Security, aren't yet completed by
189 <a href="http://www.oasis-open.org/committees/wss/">OASIS</a> or
192 *** Namespace: Microsoft.Web.Services.Security
196 * Most WSE 1.0 classes are implemented.
201 * Some classes from System.Security assembly need to be
202 duplicated (and somewhat fixed) in WSE for XMLDSIG.
204 * There are still missing classes and <b>many</b> missing
209 *** Namespace: Microsoft.Web.Services.Timestamp
213 * This seems complete for WSE 1.0 but some new classes were
214 introduced in WSE 2.0.
217 *** Namespace: Microsoft.Web.Services.Security.X509
221 * X509Certificate support is complete for both WSE 1.0 and 2.0.
226 * We need to define certificate stores (for both users and
227 machines). These sames stores must be linked with asymmetric
228 keypairs. This could also be used to store the SPC roots.
233 * Microsoft has released WSE 2.
239 There are many tools in the .NET framework that indirectly interacts
240 with some cryptographic classes. Unless noted the tools should work on
241 any CLR (tested with both Mono and Microsoft).
245 The following tools are complete (or mostly complete):
247 * <code>secutil</code> is a tool to extract certificates and
248 strongnames from assemblies in a format that can be easily
249 re-used in source code (C# or VB.NET syntax).
251 * <code>cert2spc</code> is a tool to transform multiple X.509
252 certificates and CRLs into a Software Publisher Certificate
253 (SPC) file - which is a long name for a simple PKCS#7 file.
255 * <code>makecert</code> to create X.509 test certificates that
256 can be used (once transformed in SPC) to sign assemblies. It's
257 now possible to generate SSL certificates for web servers.
259 * <code>sn</code> is a clone of the <code>sn</code> to manage
260 strongnames. Current version can create, convert, sign and
261 verify strongnames signatures. Some configuration options
262 are still missing, some will only works with Mono.
264 * <code>signcode</code> and <code>chktrust</code> for signing
265 and validating Authenticode(tm) signatures on assemblies (or
266 any PE file) are now working (signature and timestamps) but
267 some options aren't yet supported.
269 * <code>setreg</code> can change some cryptographic parameters
270 of the runtime. Currently it can add or remove two root test
271 certificates (the one used by Mono's <code>makecert</code>,
272 the other used by Microsoft's <code>makecert</code>).
274 * <code>certmgr</code> can add and remove certificates from
275 the stores. Most common use is to add new trusted certificates
279 Somewhat usable, somewhat incomplete:
281 * <code>certview</code> is a certificate viewer for
282 <code>System.Windows.Forms</code> (right now only working on
283 Windows), while <code>gcertview</code> is the same viewer
284 implemented for GTK# (working on both Windows and Linux).
289 The following tools are still missing or largely incomplete:
291 * Other tools like a, GUI-based, certificate manager...
294 Note that many of the tools requires the class library and/or the
295 runtime to be ready for them. E.g. StrongName and Authenticode signatures
296 tools are of limited use until supported by the runtime.
302 * RSA Laboratories' <a href="http://www.rsasecurity.com/rsalabs/faq/index.html">
303 Frequently Asked Questions</a> About Today's Cryptography, Version 4.1
305 * Public-Key Cryptography Standards (<a href="http://www.rsasecurity.com/rsalabs/pkcs/index.html">
308 * National Institute of Standards and Technology - Federal
309 Information Processing Standards <a href="http://csrc.nist.gov/publications/fips/index.html">
317 * Complete any of the TODO (and feel good about it ;-).
319 * Analyse the current coverage of the unit tests on the
320 cryptographic classes and complete the unit tests. <b><code>
321 monocov</code> does a great job at this! Now we just need to
322 complete the missing unit tests.</b>
324 * Optimization can also be done on most algorithms as crypto
325 is never fast enough. Some have been done using the
326 Community Edition of BoundChecker (a free VisualStudio
327 addon) - recommanded! Just be sure to test every optimization
328 (using the unit tests) carefully - it's so fast to break an
331 * Write some documentation or add some sample code for the
332 cryptographic classes in <b>monodoc</b>.
335 Last reviewed: June 26, 2004 (mono release candidate 1)