Merge branch 'cecil-light'
[mono.git] / man / certmgr.1
1 .\" 
2 .\" certmgr manual page.
3 .\" Copyright 2004-2005 Novell
4 .\" Copyright 2010 Pablo Ruiz
5 .\" Author:
6 .\"   Sebastien Pouliot <sebastien@ximian.com>
7 .\"   Pablo Ruiz Garcia <pruiz@netway.org>
8 .\"
9 .TH Mono "certmgr"
10 .SH NAME
11 certmgr \- Mono Certificate Manager (CLI version)
12 .SH SYNOPSIS
13 .PP
14 .B certmgr [action] [object type] [options] store [filename]
15 or
16 .B certmgr -ssl [options] url
17 .SH DESCRIPTION
18 This tool allow to list, add, remove or extract certificates, certificate 
19 revocation lists (CRL) or certificate trust lists (CTL) to/from a 
20 certificate store. Certificate stores are used to build and validate 
21 certificate chains for Authenticode(r) code signing validation and SSL 
22 server certificates.
23 .SH ACTIONS
24 .TP
25 .I "-list"
26 List the certificates, CTL or CTL in the specified store.
27 .TP
28 .I "-add"
29 Add a certificate, CRL or CTL to specified store. If filename it's a pkcs12 
30 or pfx file, and it contains a private key, it will be imported to local key
31 pair container.
32 .TP
33 .I "-del"
34 Remove a certificate, CRL or CTL from specified store. You must specify the 
35 object to be removed with it's hash value (and not a filename). This hash 
36 value is shown when doing a 
37 .B -list
38 on the store.
39 .TP
40 .I "-put"
41 Copy a certificate, CRL or CTL from a store to a file.
42 .TP
43 .I "-ssl"
44 Download and add the certificates from a SSL session. You'll be asked to 
45 confirm the addition of every certificate received from the server. Note 
46 that SSL/TLS protocols do not requires a server to send the root certificate.
47 This action assume an certificate (-c) object type and will import the 
48 certificates in appropriate stores (i.e. server certificate in the 
49 OtherPeople store, the root certificate in the Trust store, any other 
50 intermediate certificates in the IntermediateCA store).
51 .TP
52 .I "-importKey"
53 Allows importing a private key from a pkcs12 file into a local key pair
54 store. (Usefull when you already have the key's corresponding certificate
55 installed at the specific store.)
56
57 .SH OBJECT TYPES
58 .TP
59 .I "-c", "-cert", "-certificate"
60 Add, Delete or Put certificates. That is the specified file must/will contains
61 X.509 certificates in DER binary encoding.
62 .TP
63 .I "-crl"
64 Add, Delete or Put certificate revocation lists (CRL). That is the specified 
65 file must/will contains X.509 CRL in DER binary encoding.
66 .TP
67 .I "-ctl"
68 Add, Delete or Put certificate trust lists (CRL). UNSUPPORTED.
69
70 .SH OPTIONS
71 .TP
72 .I "-m"
73 Use the machine's certificate stores (instead of the default user's stores).
74 .TP
75 .I "-v"
76 More details displayed on the console.
77 .TP
78 .I "-p password"
79 Use the specify password when accessing a pkcs12 file.
80 .TP
81 .I "-help", "-h", "-?", "/?"
82 Display help about this tool.
83
84 .SH FILES
85 .B WARNING: This details the current behavior of Mono and could change between releases.
86 The only safe way to interact with certificate stores is to use the certmgr
87 tool. The current releases of Mono keeps all the user certificate stores in 
88 separates directories under
89 .I ~/.config/.mono/certs/
90 .TP
91 For example the trusted root certificates for a user would be kept under
92 .I ~/.config/.mono/certs/Trust/
93 .TP
94 Certificates files are kept in DER (binary) format (extension .cer).
95 .TP
96 The filenames either starts with
97 .I tbp 
98 (thumbprint) or
99 .I ski
100 (subject key identifier).
101 .TP
102 The rest of the filename is the base64-encoded value (tbp or ski).
103 .TP
104 Private key data is stored under
105 .I ~/.config/.mono/keypairs/
106
107 .SH EXAMPLES
108 .TP
109 .B mono certmgr.exe -list -c -m Trust
110 List all certificates in the machine Trust store. This will display the hash
111 value for each certificate. This value can be used to identify uniquely a 
112 certificate for some operations (e.g. delete). E.g.
113 .B Unique Hash:   FFA3AC0084DA1673B5A031EBB2156B3E8FBBF6D8
114 .TP
115 .B mono certmgr.exe -del -c -m Trust FFA3AC0084DA1673B5A031EBB2156B3E8FBBF6D8
116 Remove the certificate, represented by the hash value, from the machine Trust
117 store. Note that the machine store is normally restricted. The following
118 error message will appear if the current user doesn't have the minimum access
119 rights to remove the certificate: 
120 .B Access to the machine 'Trust' certificate store has been denied.
121 .TP
122 .B certmgr -ssl https://www.verisign.com
123 Import certificates from www.verisign.com used for HTTP over SSL. See KNOWN 
124 ISSUES (MD2) if you're downloading from www.verisign.com.
125 .TP
126 .B certmgr -ssl ldaps://www.nldap.com:636
127 Import the certificates from www.nldap.com used for secure LDAP. This works
128 even if we don't know how to speak LDAP because we stop the communication
129 shortly after the SSL handshake (which gives us the certificate).
130
131 .SH KNOWN ISSUES
132 .TP
133 .B MD2
134 Some Certificate Authorities (CA) old root certificates use the MD2 hash
135 algorithm. MD2 is old enough not to be part of the standard .NET framework. 
136 This makes it impossible to validate a digital signature made with MD2. For
137 this reason MD2 is included in the Mono.Security.dll assembly. However the
138 machine.config file must be updated so the OID for MD2 is known at runtime.
139
140 To correct this insert the following XML snippet inside the <configuration>
141 element of your machine.config file.
142   <mscorlib>
143     <cryptographySettings>
144       <cryptoNameMapping>
145         <cryptoClasses>
146           <cryptoClass monoMD2="Mono.Security.Cryptography.MD2Managed, Mono.Security, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
147         </cryptoClasses>
148         <nameEntry name="MD2" class="monoMD2" />
149       </cryptoNameMapping>
150       <oidMap>
151         <oidEntry OID="1.2.840.113549.2.2" name="MD2" />
152       </oidMap>
153     </cryptographySettings>
154   </mscorlib>
155
156 .SH AUTHOR
157 Written by Sebastien Pouliot
158
159 Minor additions by Pablo Ruiz GarcĂ­a
160 .SH COPYRIGHT
161 Copyright (C) 2004-2005 Novell.
162 .SH MAILING LISTS
163 Visit http://lists.ximian.com/mailman/listinfo/mono-list for details.
164 .SH WEB SITE
165 Visit http://www.mono-project.com for details
166 .SH SEE ALSO
167 .BR makecert(1), setreg(1)