summaryrefslogtreecommitdiff
path: root/doc/html/howto.ca.html
blob: b3625ecabde72bd76688e199b06a1fd5b2da34cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>HOWTO: Creating your own CA with OpenSSL &mdash; M2Crypto  documentation</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="M2Crypto  documentation" href="index.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="index.html">M2Crypto  documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="howto-creating-your-own-ca-with-openssl">
<span id="howto-ca"></span><h1>HOWTO: Creating your own CA with OpenSSL<a class="headerlink" href="#howto-creating-your-own-ca-with-openssl" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">author:</th><td class="field-body">Pheng Siong Ng &lt;<a class="reference external" href="mailto:ngps&#37;&#52;&#48;post1&#46;com">ngps<span>&#64;</span>post1<span>&#46;</span>com</a>&gt;</td>
</tr>
<tr class="field-even field"><th class="field-name">copyright:</th><td class="field-body">© 2000, 2001 by Ng Pheng Siong.</td>
</tr>
</tbody>
</table>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p>This is a HOWTO on creating your own <em>certification authority</em> (<em>CA</em>)
with OpenSSL.</p>
<p>I last created a CA about a year ago, when I began work on
<a class="reference external" href="https://gitlab.com/m2crypto/m2crypto/">M2Crypto</a> and needed
certificates for the SSL bits. I accepted the tools&#8217; default
settings then, e.g., certificate validity of 365 days; this meant
that my certificates, including my CA&#8217;s certificate, have now
expired.</p>
<p>Since I am using these certificates for M2Crypto&#8217;s demonstration
programs (and I have forgotten the passphrase to the CA&#8217;s private
key), I decided to discard the old CA and start afresh. I also
decided to document the process, hence this HOWTO.</p>
</div>
<div class="section" id="the-procedure">
<h2>The Procedure<a class="headerlink" href="#the-procedure" title="Permalink to this headline">¶</a></h2>
<p>I use <tt class="docutils literal"><span class="pre">CA.pl</span></tt>, a Perl program written by Steve Hanson and bundled with
OpenSSL.</p>
<p>The following are the steps to create a CA:</p>
<ol class="arabic">
<li><p class="first">Choose a directory to do your CA work. All commands are executed
within this directory. Let&#8217;s call the directory <tt class="docutils literal"><span class="pre">demo</span></tt>.</p>
</li>
<li><p class="first">Copy <tt class="docutils literal"><span class="pre">CA.pl</span></tt> and <tt class="docutils literal"><span class="pre">openssl.cnf</span></tt> into <tt class="docutils literal"><span class="pre">demo</span></tt>.</p>
</li>
<li><p class="first">Apply the following patch to <tt class="docutils literal"><span class="pre">CA.pl</span></tt>, which allows it to generate a
CA certificate with a validity period of 1095 days, i.e.,
3 years:</p>
<div class="highlight-python"><pre>--- CA.pl.org   Sat Mar 31 12:40:13 2001
+++ CA.pl       Sat Mar 31 12:41:15 2001
@@ -97,7 +97,7 @@
                } else {
                    print &quot;Making CA certificate ...\n&quot;;
                    system (&quot;$REQ -new -x509 -keyout &quot; .
-                       &quot;${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS&quot;);
+                       &quot;${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT -days 1095&quot;);
                    $RET=$?;
                }
            }</pre>
</div>
</li>
<li><p class="first">Create a new CA like this:</p>
<div class="highlight-python"><pre>./CA.pl -newca

A certificate filename (or enter to create) &lt;enter&gt;

Making CA certificate ...
Using configuration from openssl.cnf
Generating a 1024 bit RSA private key
............++++++
......................++++++
writing new private key to &#x27;./demoCA/private/cakey.pem&#x27;
Enter PEM pass phrase: &lt;secret passphrase here&gt;
Verifying password - Enter PEM pass phrase: &lt;secret passphrase again&gt;
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter &#x27;.&#x27;, the field will be left blank.
-----
Country Name (2 letter code) [AU]:SG
State or Province Name (full name) [Some-State]:.
Locality Name (eg, city) []:..
Organization Name (eg, company) [Internet Widgits Pty Ltd]:DemoCA
Organizational Unit Name (eg, section) []:.
Common Name (eg, YOUR name) []:DemoCA Certificate Master
Email Address []:certmaster@democa.dom</pre>
</div>
<p>This creates a new CA in the directory <tt class="docutils literal"><span class="pre">demoCA</span></tt>. The CA&#8217;s
self-signed certificate is in <tt class="docutils literal"><span class="pre">demoCA/cacert.pem</span></tt> and its RSA key
pair is in <tt class="docutils literal"><span class="pre">demoCA/private/cakey.pem</span></tt>.</p>
<p><tt class="docutils literal"><span class="pre">demoCA/private/cakey.pem</span></tt> looks like this:</p>
<div class="highlight-python"><pre>cat demoCA/private/cakey.pem

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,19973A9DBBB601BA

eOq9WFScNiI4/UWEUaSnGTKpJv2JYuMD3HwQox2Q3Cd4zGqVjJ6gF3exa5126cKf
X/bMVnwbPpuFZPiAIvaLyCjT6pYeXTBbSzs7/GQnvEOv+nYnDUFWi0Qm92qLk0uy
pFi/M1aWheN3vir2ZlAw+DW0bOOZhj8tC7Co7lMYb0YE271b6/YRPZCwQ3GXAHUJ
+aMYxlUDrK45aCUa/1CZDzTgk7h9cDgx2QJSIvYMYytCfI3zsuZMJS8/4OXLL0bI
lKmAc1dwB3DqGJt5XK4WJesiNfdxeCNEgAcYtEAgYZTPIApU+kTgTCIxJl2nMW7j
ax+Q1z7g+4MpgG20WD633D4z4dTlDdz+dnLi0rvuvxiwt+dUhrqiML1tyi+Z6EBH
jU4/cLBWev3rYfrlp4x8J9mDte0YKOk3t0wQOHqRetTsIfdtjnFp/Hu3qDmTCWjD
z/g7PPoO/bg/B877J9WBPbL/1hXXFYo88M+2aGlPOgDcFdiOqbLb2DCscohMbbVr
A4mgiy2kwWfIE73qiyV7yyG8FlRvr1iib+jbT3LTGf743utYAAs7HNGuOUObhoyt
jYvBD7ACn35P5YX7KTqvqErwdijxYCaNBCnvmRtmYSaNw9Kv1UJTxc5Vx7YLwIPk
E9KyBgKI7vPOjWBZ27+zOvNycmv1ciNtpALAw4bWtXnhCDVTHaVDy34OkheMzNCg
2cjcBFzOkMIjcI03KbTQXOFIQGlsTWXGzkNf/zBQ+KksT1MCj+zBXSCvlDASMckg
kef21pGgUqPF14gKGfWX3sV4bjc1vbrRwq6zlG3nMuYqR5MtJJY9eQ==
-----END RSA PRIVATE KEY-----</pre>
</div>
</li>
<li><p class="first">Next, generate a certificate request:</p>
<div class="highlight-python"><pre>./CA.pl -newreq

Using configuration from openssl.cnf
Generating a 1024 bit RSA private key
..........++++++
..............++++++
writing new private key to &#x27;newreq.pem&#x27;
Enter PEM pass phrase: &lt;another secret passphrase here&gt;
Verifying password - Enter PEM pass phrase: &lt;another secret passphrase again&gt;
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter &#x27;.&#x27;, the field will be left blank.
-----
Country Name (2 letter code) [AU]:SG
State or Province Name (full name) [Some-State]:..
Locality Name (eg, city) []:.
Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto
Organizational Unit Name (eg, section) []:.
Common Name (eg, YOUR name) []:localhost
Email Address []:admin@server.example.dom

Please enter the following &#x27;extra&#x27; attributes
to be sent with your certificate request
A challenge password []:&lt;enter&gt;
An optional company name []:&lt;enter&gt;
Request (and private key) is in newreq.pem</pre>
</div>
</li>
</ol>
<p></p>
<blockquote>
<div><p>The certificate request and private key in <tt class="docutils literal"><span class="pre">newreq.pem</span></tt> looks like
this:</p>
<div class="highlight-python"><pre>cat newreq.pem

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,41B2874DF3D02DD4

mg611EoVkLEooSTv+qTM0Ddmm/M1jE/Jy5RD/sc3LSMhuGu9xc26OgsTJmkQuIAh
J/B4lAw8G59VTG6DykeEtrG0rUBx4bggc7PKbFuiN423YjJODWcHvVgnPOzXMQt+
lY4tPl5+217MRHyx2NsWGrpkQNdu3GeSPOVMl3jeQiaXupONbwQ7rj42+X/VtAJP
W4D1NNwu8aGCPyShsEXHc/fI1WDpphYWke97pOjIZVQESFZOPty5HjIYZux4U+td
W81xODtq2ecJXc8fn2Wpa9y5VD1LT7oJksOuL1+Z04OVaeUe4x0swM17HlBm2kVt
fe/C/L6kN27MwZhE331VjtTjSGl4/gknqQDbLOtqT06f3OISsDJETm2itllyhgzv
C6Fi3N03rGFmKectijC+tws5k+P+HRG6sai33usk8xPokJqA+HYSWPz1XVlpRmv4
kdjQOdST7ovU62mOTgf3ARcduPPwuzTfxOlYONe5NioO1APVHBrInQwcpLkpOTQR
vI4roIN+b75/nihUWGUJn/nbbBa2Yl0N5Gs1Tyiy9Z+CcRT2TfWKBBFlEUIFl7Mb
J9fTV3DI+k+akbR4il1NkQ8EcSmCr3WpA0I9n0EHI7ZVpVaHxc0sqaPFl8YGdFHq
1Qk53C/w6+qPpDzT3yKFmG2LZytAAM1czvb6RbNRJJP2ZrpBwn/h99sUTo/yPfxY
nueYmFJDm0uVNtG0icXGNUfSfnjKNTtHPAgyKGetRIC3kgJz/bo2w7EI6iEjBAzK
l5TRm4x6ZJxwuXXMiJCehMMd8TC8ybwWO4AO19B3ebFFeTVsUgxSGA==
-----END RSA PRIVATE KEY-----
-----BEGIN CERTIFICATE REQUEST-----
MIIBnTCCAQYCAQAwXTELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRIw
EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGFkbWluQHNlcnZlci5l
eGFtcGxlLmRvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr1nYY1Qrll1r
uB/FqlCRrr5nvupdIN+3wF7q915tvEQoc74bnu6b8IbbGRMhzdzmvQ4SzFfVEAuM
MuTHeybPq5th7YDrTNizKKxOBnqE2KYuX9X22A1Kh49soJJFg6kPb9MUgiZBiMlv
tb7K3CHfgw5WagWnLl8Lb+ccvKZZl+8CAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4GB
AHpoRp5YS55CZpy+wdigQEwjL/wSluvo+WjtpvP0YoBMJu4VMKeZi405R7o8oEwi
PdlrrliKNknFmHKIaCKTLRcU59ScA6ADEIWUzqmUzP5Cs6jrSRo3NKfg1bd09D1K
9rsQkRc9Urv9mRBIsredGnYECNeRaK5R1yzpOowninXC
-----END CERTIFICATE REQUEST-----</pre>
</div>
</div></blockquote>
<p></p>
<blockquote>
<div><p>Decoding the certificate request gives the following:</p>
<div class="highlight-python"><pre>openssl req -text -noout &lt; newreq.pem

Using configuration from /usr/local/pkg/openssl/openssl.cnf
Certificate Request:
   Data:
       Version: 0 (0x0)
       Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom
       Subject Public Key Info:
           Public Key Algorithm: rsaEncryption
           RSA Public Key: (1024 bit)
               Modulus (1024 bit):
                   00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50:
                   91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e:
                   6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13:
                   21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4:
                   c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac:
                   4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f:
                   6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9:
                   6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f:
                   0b:6f:e7:1c:bc:a6:59:97:ef
               Exponent: 65537 (0x10001)
       Attributes:
           a0:00
   Signature Algorithm: md5WithRSAEncryption
       7a:68:46:9e:58:4b:9e:42:66:9c:be:c1:d8:a0:40:4c:23:2f:
       fc:12:96:eb:e8:f9:68:ed:a6:f3:f4:62:80:4c:26:ee:15:30:
       a7:99:8b:8d:39:47:ba:3c:a0:4c:22:3d:d9:6b:ae:58:8a:36:
       49:c5:98:72:88:68:22:93:2d:17:14:e7:d4:9c:03:a0:03:10:
       85:94:ce:a9:94:cc:fe:42:b3:a8:eb:49:1a:37:34:a7:e0:d5:
       b7:74:f4:3d:4a:f6:bb:10:91:17:3d:52:bb:fd:99:10:48:b2:
       b7:9d:1a:76:04:08:d7:91:68:ae:51:d7:2c:e9:3a:8c:27:8a:
       75:c2</pre>
</div>
</div></blockquote>
<ol class="arabic" start="6">
<li><p class="first">Now, sign the certificate request:</p>
<div class="highlight-python"><pre>./CA.pl -sign

Using configuration from openssl.cnf
Enter PEM pass phrase: &lt;CA&#x27;s passphrase&gt;
Check that the request matches the signature
Signature ok
The Subjects Distinguished Name is as follows
countryName           :PRINTABLE:&#x27;SG&#x27;
organizationName      :PRINTABLE:&#x27;M2Crypto&#x27;
commonName            :PRINTABLE:&#x27;localhost&#x27;
emailAddress          :IA5STRING:&#x27;admin@server.example.dom&#x27;
Certificate is to be certified until Mar 31 02:57:30 2002 GMT (365 days)
Sign the certificate? [y/n]:y


1 out of 1 certificate requests certified, commit?  [y/n]y
Write out database with 1 new entries
Data Base Updated
Signed certificate is in newcert.pem</pre>
</div>
</li>
</ol>
<p></p>
<blockquote>
<div><p><tt class="docutils literal"><span class="pre">newcert.pem</span></tt> looks like this:</p>
<div class="highlight-python"><pre>cat newcert.pem

Certificate:
Data:
   Version: 3 (0x2)
   Serial Number: 1 (0x1)
   Signature Algorithm: md5WithRSAEncryption
   Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom
   Validity
       Not Before: Mar 31 02:57:30 2001 GMT
       Not After : Mar 31 02:57:30 2002 GMT
   Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom
   Subject Public Key Info:
       Public Key Algorithm: rsaEncryption
       RSA Public Key: (1024 bit)
           Modulus (1024 bit):
               00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50:
               91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e:
               6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13:
               21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4:
               c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac:
               4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f:
               6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9:
               6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f:
               0b:6f:e7:1c:bc:a6:59:97:ef
           Exponent: 65537 (0x10001)
   X509v3 extensions:
       X509v3 Basic Constraints:
Certificate:
Data:
   Version: 3 (0x2)
   Serial Number: 1 (0x1)
   Signature Algorithm: md5WithRSAEncryption
   Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom
   Validity
       Not Before: Mar 31 02:57:30 2001 GMT
       Not After : Mar 31 02:57:30 2002 GMT
   Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom
   Subject Public Key Info:
       Public Key Algorithm: rsaEncryption
       RSA Public Key: (1024 bit)
           Modulus (1024 bit):
               00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50:
               91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e:
               6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13:
               21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4:
               c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac:
               4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f:
               6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9:
               6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f:
               0b:6f:e7:1c:bc:a6:59:97:ef
           Exponent: 65537 (0x10001)
   X509v3 extensions:
       X509v3 Basic Constraints:
           CA:FALSE
       Netscape Comment:
           OpenSSL Generated Certificate
       X509v3 Subject Key Identifier:
           B3:D6:89:88:2F:B1:15:40:EC:0A:C0:30:35:3A:B7:DA:72:73:1B:4D
       X509v3 Authority Key Identifier:
           keyid:F9:6A:A6:34:97:6B:BC:BB:5A:17:0D:19:FC:62:21:0B:00:B5:0E:29
           DirName:/C=SG/O=DemoCA/CN=DemoCA Certificate Master/Email=certmaster@democa.dom
           serial:00

Signature Algorithm: md5WithRSAEncryption</pre>
</div>
</div></blockquote>
<ol class="arabic" start="7">
<li><p class="first">In certain situations, e.g., where your certificate and private key
are to be used in an unattended SSL server, you may wish to not
encrypt the private key, i.e., leave the key in the clear. This
decision should be governed by your site&#8217;s security policy and threat
model, of course:</p>
<div class="highlight-python"><pre>openssl rsa &lt; newkey.pem &gt; newkey2.pem

read RSA key
Enter PEM pass phrase:&lt;secret passphrase here&gt;
writing RSA key</pre>
</div>
<p><tt class="docutils literal"><span class="pre">newkey2.pem</span></tt> looks like this:</p>
<div class="highlight-python"><pre>cat newkey2.pem

-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQCvWdhjVCuWXWu4H8WqUJGuvme+6l0g37fAXur3Xm28RChzvhue
7pvwhtsZEyHN3Oa9DhLMV9UQC4wy5Md7Js+rm2HtgOtM2LMorE4GeoTYpi5f1fbY
DUqHj2ygkkWDqQ9v0xSCJkGIyW+1vsrcId+DDlZqBacuXwtv5xy8plmX7wIDAQAB
AoGAbAkU8w3W1Qu15Hle1bJSL7GMReoreqeblOBmMAZz4by0l6sXZXJpjWXo86f/
+dASMYTMPC4ZTYtv06N07AFbjL+kDfqDMTfzQkYMHp1LAq1Ihbq1rHWSBH5n3ekq
KiY8JKpv8DR5Po1iKaXJFuDByGDENJwYbSRSpSK3P+vkWWECQQDkEUE/ZPqqqZkQ
2iWRPAsCbEID8SAraQl3DdCLYs/GgARfmmj4yUHEwkys9Jo1H8k4BdxugmaUwNi5
YQ/CVzrXAkEAxNO80ArbGxPUmr11GHG/bGBYj1DUBkHZSc7dgxZdtUCLGNxQnNsg
Iwq3n6j1sUzS3UW6abQ8bivYNOUcMKJAqQJBANQxFaLU4b/NQaODQ3aoBZpAfP9L
5eFdvbet+7zjt2r5CpikgkwOfAmDuXEltx/8LevY0CllW+nErx9zJgVrwUsCQQCu
76H5JiznPBDSF2FjgHWqVVdgyW4owY3mU739LHvNBLicN/RN9VPy0Suy8/CqzKT9
lWPBXzf2k3FuUdNkRlFBAkEAmpXoybuiFR2S5Bma/ax96lVs0/VihhfC1zZP/X/F
Br77+h9dIul+2DnyOl50zu0Sdzst1/7ay4JSDHyiBCMGSQ==
-----END RSA PRIVATE KEY-----</pre>
</div>
</li>
</ol>
<p>That&#8217;s it! The certificate, <tt class="docutils literal"><span class="pre">newcert.pem</span></tt>, and the private key -
<tt class="docutils literal"><span class="pre">newkey.pem</span></tt> (encrypted) or <tt class="docutils literal"><span class="pre">newkey2.pem</span></tt> (unencrypted) - are now
ready to be used. You may wish to rename the files to more intuitive
names.</p>
<p>You should also keep the CA&#8217;s certificate <tt class="docutils literal"><span class="pre">demo/cacert.pem</span></tt> handy
for use when developing and deploying SSL or S/MIME applications.</p>
</div>
<div class="section" id="conclusion">
<h2>Conclusion<a class="headerlink" href="#conclusion" title="Permalink to this headline">¶</a></h2>
<p>We&#8217;ve walked through the basic steps in the creation of a CA and
certificates using the tools that come with OpenSSL. We did not cover
more advanced topics such as constraining a certificate to be SSL-only
or S/MIME-only.</p>
<p>There exist several HOWTOs similar to this one on the net. This one is
written specifically to facilitate discussions in my other HOWTOs on
developing SSL and S/MIME applications in
<a class="reference external" href="http://www.python.org">Python</a> using
<a class="reference external" href="https://gitlab.com/m2crypto/m2crypto/">M2Crypto</a>.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">HOWTO: Creating your own CA with OpenSSL</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#the-procedure">The Procedure</a></li>
<li><a class="reference internal" href="#conclusion">Conclusion</a></li>
</ul>
</li>
</ul>

  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/howto.ca.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li><a href="index.html">M2Crypto  documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2017, Matej Cepl &lt;mcepl@cepl.eu&gt;.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>