]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/usr.bin/openssl/man/CA.pl.1
Regen manual pages.
[FreeBSD/FreeBSD.git] / secure / usr.bin / openssl / man / CA.pl.1
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "CA.PL 1"
132 .TH CA.PL 1 "2018-09-11" "1.1.1" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 CA.pl \- friendlier interface for OpenSSL certificate programs
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 \&\fB\s-1CA\s0.pl\fR
142 \&\fB\-?\fR |
143 \&\fB\-h\fR |
144 \&\fB\-help\fR
145 .PP
146 \&\fB\s-1CA\s0.pl\fR
147 \&\fB\-newcert\fR |
148 \&\fB\-newreq\fR |
149 \&\fB\-newreq\-nodes\fR |
150 \&\fB\-xsign\fR |
151 \&\fB\-sign\fR |
152 \&\fB\-signCA\fR |
153 \&\fB\-signcert\fR |
154 \&\fB\-crl\fR |
155 \&\fB\-newca\fR
156 [\fB\-extra\-cmd\fR extra\-params]
157 .PP
158 \&\fB\s-1CA\s0.pl\fR \fB\-pkcs12\fR [\fB\-extra\-pkcs12\fR extra\-params] [\fBcertname\fR]
159 .PP
160 \&\fB\s-1CA\s0.pl\fR \fB\-verify\fR [\fB\-extra\-verify\fR extra\-params] \fBcertfile\fR...
161 .PP
162 \&\fB\s-1CA\s0.pl\fR \fB\-revoke\fR [\fB\-extra\-ca\fR extra\-params] \fBcertfile\fR [\fBreason\fR]
163 .SH "DESCRIPTION"
164 .IX Header "DESCRIPTION"
165 The \fB\s-1CA\s0.pl\fR script is a perl script that supplies the relevant command line
166 arguments to the \fBopenssl\fR command for some common certificate operations.
167 It is intended to simplify the process of certificate creation and management
168 by the use of some simple options.
169 .SH "OPTIONS"
170 .IX Header "OPTIONS"
171 .IP "\fB?\fR, \fB\-h\fR, \fB\-help\fR" 4
172 .IX Item "?, -h, -help"
173 Prints a usage message.
174 .IP "\fB\-newcert\fR" 4
175 .IX Item "-newcert"
176 Creates a new self signed certificate. The private key is written to the file
177 \&\*(L"newkey.pem\*(R" and the request written to the file \*(L"newreq.pem\*(R".
178 This argument invokes \fBopenssl req\fR command.
179 .IP "\fB\-newreq\fR" 4
180 .IX Item "-newreq"
181 Creates a new certificate request. The private key is written to the file
182 \&\*(L"newkey.pem\*(R" and the request written to the file \*(L"newreq.pem\*(R".
183 Executes \fBopenssl req\fR command below the hood.
184 .IP "\fB\-newreq\-nodes\fR" 4
185 .IX Item "-newreq-nodes"
186 Is like \fB\-newreq\fR except that the private key will not be encrypted.
187 Uses \fBopenssl req\fR command.
188 .IP "\fB\-newca\fR" 4
189 .IX Item "-newca"
190 Creates a new \s-1CA\s0 hierarchy for use with the \fBca\fR program (or the \fB\-signcert\fR
191 and \fB\-xsign\fR options). The user is prompted to enter the filename of the \s-1CA\s0
192 certificates (which should also contain the private key) or by hitting \s-1ENTER\s0
193 details of the \s-1CA\s0 will be prompted for. The relevant files and directories
194 are created in a directory called \*(L"demoCA\*(R" in the current directory.
195 \&\fBopenssl req\fR and \fBopenssl ca\fR commands are get invoked.
196 .IP "\fB\-pkcs12\fR" 4
197 .IX Item "-pkcs12"
198 Create a PKCS#12 file containing the user certificate, private key and \s-1CA\s0
199 certificate. It expects the user certificate and private key to be in the
200 file \*(L"newcert.pem\*(R" and the \s-1CA\s0 certificate to be in the file demoCA/cacert.pem,
201 it creates a file \*(L"newcert.p12\*(R". This command can thus be called after the
202 \&\fB\-sign\fR option. The PKCS#12 file can be imported directly into a browser.
203 If there is an additional argument on the command line it will be used as the
204 \&\*(L"friendly name\*(R" for the certificate (which is typically displayed in the browser
205 list box), otherwise the name \*(L"My Certificate\*(R" is used.
206 Delegates work to \fBopenssl pkcs12\fR command.
207 .IP "\fB\-sign\fR, \fB\-signcert\fR, \fB\-xsign\fR" 4
208 .IX Item "-sign, -signcert, -xsign"
209 Calls the \fBca\fR program to sign a certificate request. It expects the request
210 to be in the file \*(L"newreq.pem\*(R". The new certificate is written to the file
211 \&\*(L"newcert.pem\*(R" except in the case of the \fB\-xsign\fR option when it is written
212 to standard output. Leverages \fBopenssl ca\fR command.
213 .IP "\fB\-signCA\fR" 4
214 .IX Item "-signCA"
215 This option is the same as the \fB\-signreq\fR option except it uses the
216 configuration file section \fBv3_ca\fR and so makes the signed request a
217 valid \s-1CA\s0 certificate. This is useful when creating intermediate \s-1CA\s0 from
218 a root \s-1CA.\s0  Extra params are passed on to \fBopenssl ca\fR command.
219 .IP "\fB\-signcert\fR" 4
220 .IX Item "-signcert"
221 This option is the same as \fB\-sign\fR except it expects a self signed certificate
222 to be present in the file \*(L"newreq.pem\*(R".
223 Extra params are passed on to \fBopenssl x509\fR and \fBopenssl ca\fR commands.
224 .IP "\fB\-crl\fR" 4
225 .IX Item "-crl"
226 Generate a \s-1CRL.\s0 Executes \fBopenssl ca\fR command.
227 .IP "\fB\-revoke certfile [reason]\fR" 4
228 .IX Item "-revoke certfile [reason]"
229 Revoke the certificate contained in the specified \fBcertfile\fR. An optional
230 reason may be specified, and must be one of: \fBunspecified\fR,
231 \&\fBkeyCompromise\fR, \fBCACompromise\fR, \fBaffiliationChanged\fR, \fBsuperseded\fR,
232 \&\fBcessationOfOperation\fR, \fBcertificateHold\fR, or \fBremoveFromCRL\fR.
233 Leverages \fBopenssl ca\fR command.
234 .IP "\fB\-verify\fR" 4
235 .IX Item "-verify"
236 Verifies certificates against the \s-1CA\s0 certificate for \*(L"demoCA\*(R". If no
237 certificates are specified on the command line it tries to verify the file
238 \&\*(L"newcert.pem\*(R".  Invokes \fBopenssl verify\fR command.
239 .IP "\fB\-extra\-req\fR | \fB\-extra\-ca\fR | \fB\-extra\-pkcs12\fR | \fB\-extra\-x509\fR | \fB\-extra\-verify\fR <extra\-params>" 4
240 .IX Item "-extra-req | -extra-ca | -extra-pkcs12 | -extra-x509 | -extra-verify <extra-params>"
241 The purpose of these parameters is to allow optional parameters to be supplied
242 to \fBopenssl\fR that this command executes. The \fB\-extra\-cmd\fR are specific to the
243 option being used and the \fBopenssl\fR command getting invoked. For example
244 when this command invokes \fBopenssl req\fR extra parameters can be passed on
245 with the \fB\-extra\-req\fR parameter. The
246 \&\fBopenssl\fR commands being invoked per option are documented below.
247 Users should consult \fBopenssl\fR command documentation for more information.
248 .SH "EXAMPLES"
249 .IX Header "EXAMPLES"
250 Create a \s-1CA\s0 hierarchy:
251 .PP
252 .Vb 1
253 \& CA.pl \-newca
254 .Ve
255 .PP
256 Complete certificate creation example: create a \s-1CA,\s0 create a request, sign
257 the request and finally create a PKCS#12 file containing it.
258 .PP
259 .Vb 4
260 \& CA.pl \-newca
261 \& CA.pl \-newreq
262 \& CA.pl \-signreq
263 \& CA.pl \-pkcs12 "My Test Certificate"
264 .Ve
265 .SH "DSA CERTIFICATES"
266 .IX Header "DSA CERTIFICATES"
267 Although the \fB\s-1CA\s0.pl\fR creates \s-1RSA\s0 CAs and requests it is still possible to
268 use it with \s-1DSA\s0 certificates and requests using the \fIreq\fR\|(1) command
269 directly. The following example shows the steps that would typically be taken.
270 .PP
271 Create some \s-1DSA\s0 parameters:
272 .PP
273 .Vb 1
274 \& openssl dsaparam \-out dsap.pem 1024
275 .Ve
276 .PP
277 Create a \s-1DSA CA\s0 certificate and private key:
278 .PP
279 .Vb 1
280 \& openssl req \-x509 \-newkey dsa:dsap.pem \-keyout cacert.pem \-out cacert.pem
281 .Ve
282 .PP
283 Create the \s-1CA\s0 directories and files:
284 .PP
285 .Vb 1
286 \& CA.pl \-newca
287 .Ve
288 .PP
289 enter cacert.pem when prompted for the \s-1CA\s0 file name.
290 .PP
291 Create a \s-1DSA\s0 certificate request and private key (a different set of parameters
292 can optionally be created first):
293 .PP
294 .Vb 1
295 \& openssl req \-out newreq.pem \-newkey dsa:dsap.pem
296 .Ve
297 .PP
298 Sign the request:
299 .PP
300 .Vb 1
301 \& CA.pl \-signreq
302 .Ve
303 .SH "NOTES"
304 .IX Header "NOTES"
305 Most of the filenames mentioned can be modified by editing the \fB\s-1CA\s0.pl\fR script.
306 .PP
307 If the demoCA directory already exists then the \fB\-newca\fR command will not
308 overwrite it and will do nothing. This can happen if a previous call using
309 the \fB\-newca\fR option terminated abnormally. To get the correct behaviour
310 delete the demoCA directory if it already exists.
311 .PP
312 Under some environments it may not be possible to run the \fB\s-1CA\s0.pl\fR script
313 directly (for example Win32) and the default configuration file location may
314 be wrong. In this case the command:
315 .PP
316 .Vb 1
317 \& perl \-S CA.pl
318 .Ve
319 .PP
320 can be used and the \fB\s-1OPENSSL_CONF\s0\fR environment variable changed to point to
321 the correct path of the configuration file.
322 .PP
323 The script is intended as a simple front end for the \fBopenssl\fR program for use
324 by a beginner. Its behaviour isn't always what is wanted. For more control over the
325 behaviour of the certificate commands call the \fBopenssl\fR command directly.
326 .SH "SEE ALSO"
327 .IX Header "SEE ALSO"
328 \&\fIx509\fR\|(1), \fIca\fR\|(1), \fIreq\fR\|(1), \fIpkcs12\fR\|(1),
329 \&\fIconfig\fR\|(5)
330 .SH "COPYRIGHT"
331 .IX Header "COPYRIGHT"
332 Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
333 .PP
334 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
335 this file except in compliance with the License.  You can obtain a copy
336 in the file \s-1LICENSE\s0 in the source distribution or at
337 <https://www.openssl.org/source/license.html>.