Rocco Rutte:
[apps/madmutt.git] / doc / smime-notes.txt
1 How to add use mutt's S/MIME capabilities
2
3 - Add the contents of contrib/smime.rc to your .muttrc. Don't worry about
4   changing the smime_sign_as line at this point -- you'll change it later.
5
6 - Run 'smime_keys init'.
7
8 - Download and install OpenSSL.
9
10 - Get yourself a certificate. (You can get one for free from www.thawte.com,
11   or pay for one from VeriSign or one of its competitors) The way the
12   process generally works, the certificate will be installed "into" your web
13   browser.  If you are asked what application you wish to use the
14   certificate with, select Netscape. Strangely enough, "mutt" is usually not
15   an option.
16
17 - Assuming you are using Mozilla, follow the instructions at
18   www.verisignlabs.com/Projects/smime_docs/linux.html to export the
19   certificate into a file called cert.p12. If you don't use Mozilla, you're
20   on your own.
21
22 - Run "smime_keys add_p12 cert.p12"
23
24     * When the script asks for the "Import password", enter the one you
25       provided when you exported the certificate.
26
27     * When it asks for a "PEM pass phrase", make up a new password. Every
28       time you sign or decrypt a message, mutt will ask for the PEM pass
29       phrase.
30
31     * Finally, when the script asks for a label, enter an easy-to-remember
32       name for the certificate, such as "me". The script output will include
33       a line like:
34
35       added private key: /home/raldi/.smime/keys/12345678.0 for raldi@verisignlabs.com
36
37       The number (including the ".0" at the end) is your keyid. You will
38       need this number in the next step.
39
40 - Edit the smime_sign_as line in your muttrc, replacing the keyid with your
41   own.
42
43 - You probably want to import the trusted roots in
44   contrib/ca-bundle.crt. This makes you trust anything that was ultimately
45   signed by one of them. You can use "smime_keys add_root" to do so, or
46   just copy ca-bundle.crt into the place you point mutt's smime_ca_location
47   variable to.
48
49
50
51 Other notes
52
53 Key management is done in a way similar to OpenSSL's CA directory. Private
54 keys and certificates are stored in different directories, as OpenSSL
55 expects either to be supplied in a (distinct) file. Each directory contains
56 an unsorted file named '.index' wherin each line has several fields:
57 mailbox, keyid, label, id of the intermediate certificate and keyflags.
58
59     * Keyid is a hashvalue derived from the subject field of a certificate
60       and supplied by OpenSSL.
61
62     * The mailbox address is derived from either From or Sender field of the
63       message, and matched with the email field of the certificate. Non
64       matching address pairs get rejected, as get certificates not
65       containing a mailbox address at all. (These are security issues, that
66       perhaps should be configurable.)
67
68     * Label is set by the perl script (it will ask you to supply one), when
69       you add your keypair to the database. So are the remaining two fields.
70
71     * keyflags are set with certificate verification option of the perl
72       script. It may take as value one of the following: i: invalid
73       (verification failed), r: revoked, e: expired, u: unverified, v:
74       successfully verified and finally t: trusted, in case it was
75       successfully verified and you chose to trust the certificate (the
76       script will ask you). Mutt will not use invalid, revoked or expired
77       certificates for signing or encryption. It will ask for confirmation
78       before using unverified certificates, and finally it will issue a
79       warning before using successfully verified but untrusted certificates.
80
81 The purpose fields of a certificate do not get verified yet, also there is
82 no real check if the given file is a certificate at all.
83
84 Key retrieval is done obviously by searching the index file for a given
85 mailbox. If none is found, the user is presented a list of available keys
86 and asked to select one of those.
87
88 The certificate and key directories specified in muttrc have to exist. Mutt
89 will not create them. If you wish to sign messages yourself, note that this
90 mutt does not address any PKCS10 or PKCS12 issues (yet?); that is, you have
91 to get a valid certficate outside of mutt. (See above)
92
93
94
95 A certificate can be viewed by adding the following to your ~/.mailcap:
96
97 application/x-pkcs7-signature;openssl pkcs7 -in %s -inform der -noout \
98 -print_certs -text | less; needsterminal