Update files for OpenSSL-1.0.0f import.
[dragonfly.git] / secure / usr.bin / openssl / man / CA.pl.1
CommitLineData
e3261593 1.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.19)
8b0cefbb
JR
2.\"
3.\" Standard preamble:
4.\" ========================================================================
8b0cefbb 5.de Sp \" Vertical space (when we can't use .PP)
984263bc
MD
6.if t .sp .5v
7.if n .sp
8..
8b0cefbb 9.de Vb \" Begin verbatim text
984263bc
MD
10.ft CW
11.nf
12.ne \\$1
13..
8b0cefbb 14.de Ve \" End verbatim text
984263bc 15.ft R
984263bc
MD
16.fi
17..
8b0cefbb
JR
18.\" Set up some character translations and predefined strings. \*(-- will
19.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
e257b235
PA
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-
8b0cefbb 25.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
984263bc 26.ie n \{\
8b0cefbb
JR
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' ""
984263bc
MD
35'br\}
36.el\{\
8b0cefbb
JR
37. ds -- \|\(em\|
38. ds PI \(*p
39. ds L" ``
40. ds R" ''
984263bc 41'br\}
8b0cefbb 42.\"
e257b235
PA
43.\" Escape single quotes in literal strings from groff's Unicode transform.
44.ie \n(.g .ds Aq \(aq
45.el .ds Aq '
46.\"
8b0cefbb 47.\" If the F register is turned on, we'll generate index entries on stderr for
01185282 48.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
8b0cefbb
JR
49.\" entries marked with X<> in POD. Of course, you'll have to process the
50.\" output yourself in some meaningful fashion.
e257b235 51.ie \nF \{\
8b0cefbb
JR
52. de IX
53. tm Index:\\$1\t\\n%\t"\\$2"
984263bc 54..
8b0cefbb
JR
55. nr % 0
56. rr F
984263bc 57.\}
e257b235
PA
58.el \{\
59. de IX
60..
61.\}
aac4ff6f 62.\"
8b0cefbb
JR
63.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64.\" Fear. Run. Save yourself. No user-serviceable parts.
65. \" fudge factors for nroff and troff
984263bc 66.if n \{\
8b0cefbb
JR
67. ds #H 0
68. ds #V .8m
69. ds #F .3m
70. ds #[ \f1
71. ds #] \fP
984263bc
MD
72.\}
73.if t \{\
8b0cefbb
JR
74. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75. ds #V .6m
76. ds #F 0
77. ds #[ \&
78. ds #] \&
984263bc 79.\}
8b0cefbb 80. \" simple accents for nroff and troff
984263bc 81.if n \{\
8b0cefbb
JR
82. ds ' \&
83. ds ` \&
84. ds ^ \&
85. ds , \&
86. ds ~ ~
87. ds /
984263bc
MD
88.\}
89.if t \{\
8b0cefbb
JR
90. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
984263bc 96.\}
8b0cefbb 97. \" troff and (daisy-wheel) nroff accents
984263bc
MD
98.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105.ds ae a\h'-(\w'a'u*4/10)'e
106.ds Ae A\h'-(\w'A'u*4/10)'E
8b0cefbb 107. \" corrections for vroff
984263bc
MD
108.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
8b0cefbb 110. \" for low resolution devices (crt and lpr)
984263bc
MD
111.if \n(.H>23 .if \n(.V>19 \
112\{\
8b0cefbb
JR
113. ds : e
114. ds 8 ss
115. ds o a
116. ds d- d\h'-1'\(ga
117. ds D- D\h'-1'\(hy
118. ds th \o'bp'
119. ds Th \o'LP'
120. ds ae ae
121. ds Ae AE
984263bc
MD
122.\}
123.rm #[ #] #H #V #F C
8b0cefbb
JR
124.\" ========================================================================
125.\"
126.IX Title "CA.PL 1"
e3261593 127.TH CA.PL 1 "2012-01-04" "1.0.0f" "OpenSSL"
e257b235
PA
128.\" For nroff, turn off justification. Always turn off hyphenation; it makes
129.\" way too many mistakes in technical documents.
130.if n .ad l
131.nh
984263bc 132.SH "NAME"
e3cdf75b 133CA.pl \- friendlier interface for OpenSSL certificate programs
984263bc 134.SH "SYNOPSIS"
8b0cefbb
JR
135.IX Header "SYNOPSIS"
136\&\fB\s-1CA\s0.pl\fR
984263bc
MD
137[\fB\-?\fR]
138[\fB\-h\fR]
139[\fB\-help\fR]
140[\fB\-newcert\fR]
141[\fB\-newreq\fR]
8b0cefbb 142[\fB\-newreq\-nodes\fR]
984263bc
MD
143[\fB\-newca\fR]
144[\fB\-xsign\fR]
145[\fB\-sign\fR]
146[\fB\-signreq\fR]
147[\fB\-signcert\fR]
148[\fB\-verify\fR]
149[\fBfiles\fR]
150.SH "DESCRIPTION"
8b0cefbb
JR
151.IX Header "DESCRIPTION"
152The \fB\s-1CA\s0.pl\fR script is a perl script that supplies the relevant command line
984263bc
MD
153arguments to the \fBopenssl\fR command for some common certificate operations.
154It is intended to simplify the process of certificate creation and management
155by the use of some simple options.
156.SH "COMMAND OPTIONS"
8b0cefbb
JR
157.IX Header "COMMAND OPTIONS"
158.IP "\fB?\fR, \fB\-h\fR, \fB\-help\fR" 4
159.IX Item "?, -h, -help"
984263bc 160prints a usage message.
8b0cefbb
JR
161.IP "\fB\-newcert\fR" 4
162.IX Item "-newcert"
984263bc
MD
163creates a new self signed certificate. The private key and certificate are
164written to the file \*(L"newreq.pem\*(R".
8b0cefbb
JR
165.IP "\fB\-newreq\fR" 4
166.IX Item "-newreq"
984263bc
MD
167creates a new certificate request. The private key and request are
168written to the file \*(L"newreq.pem\*(R".
a561f9ff
SS
169.IP "\fB\-newreq\-nodes\fR" 4
170.IX Item "-newreq-nodes"
984263bc 171is like \fB\-newreq\fR except that the private key will not be encrypted.
8b0cefbb
JR
172.IP "\fB\-newca\fR" 4
173.IX Item "-newca"
984263bc
MD
174creates a new \s-1CA\s0 hierarchy for use with the \fBca\fR program (or the \fB\-signcert\fR
175and \fB\-xsign\fR options). The user is prompted to enter the filename of the \s-1CA\s0
176certificates (which should also contain the private key) or by hitting \s-1ENTER\s0
177details of the \s-1CA\s0 will be prompted for. The relevant files and directories
178are created in a directory called \*(L"demoCA\*(R" in the current directory.
8b0cefbb
JR
179.IP "\fB\-pkcs12\fR" 4
180.IX Item "-pkcs12"
181create a PKCS#12 file containing the user certificate, private key and \s-1CA\s0
984263bc
MD
182certificate. It expects the user certificate and private key to be in the
183file \*(L"newcert.pem\*(R" and the \s-1CA\s0 certificate to be in the file demoCA/cacert.pem,
184it creates a file \*(L"newcert.p12\*(R". This command can thus be called after the
8b0cefbb 185\&\fB\-sign\fR option. The PKCS#12 file can be imported directly into a browser.
984263bc 186If there is an additional argument on the command line it will be used as the
8b0cefbb 187\&\*(L"friendly name\*(R" for the certificate (which is typically displayed in the browser
984263bc 188list box), otherwise the name \*(L"My Certificate\*(R" is used.
8b0cefbb
JR
189.IP "\fB\-sign\fR, \fB\-signreq\fR, \fB\-xsign\fR" 4
190.IX Item "-sign, -signreq, -xsign"
984263bc
MD
191calls the \fBca\fR program to sign a certificate request. It expects the request
192to be in the file \*(L"newreq.pem\*(R". The new certificate is written to the file
8b0cefbb 193\&\*(L"newcert.pem\*(R" except in the case of the \fB\-xsign\fR option when it is written
984263bc 194to standard output.
8b0cefbb
JR
195.IP "\fB\-signCA\fR" 4
196.IX Item "-signCA"
984263bc
MD
197this option is the same as the \fB\-signreq\fR option except it uses the configuration
198file section \fBv3_ca\fR and so makes the signed request a valid \s-1CA\s0 certificate. This
199is useful when creating intermediate \s-1CA\s0 from a root \s-1CA\s0.
8b0cefbb
JR
200.IP "\fB\-signcert\fR" 4
201.IX Item "-signcert"
984263bc
MD
202this option is the same as \fB\-sign\fR except it expects a self signed certificate
203to be present in the file \*(L"newreq.pem\*(R".
8b0cefbb
JR
204.IP "\fB\-verify\fR" 4
205.IX Item "-verify"
984263bc 206verifies certificates against the \s-1CA\s0 certificate for \*(L"demoCA\*(R". If no certificates
e257b235 207are specified on the command line it tries to verify the file \*(L"newcert.pem\*(R".
8b0cefbb
JR
208.IP "\fBfiles\fR" 4
209.IX Item "files"
984263bc
MD
210one or more optional certificate file names for use with the \fB\-verify\fR command.
211.SH "EXAMPLES"
8b0cefbb
JR
212.IX Header "EXAMPLES"
213Create a \s-1CA\s0 hierarchy:
984263bc
MD
214.PP
215.Vb 1
e257b235 216\& CA.pl \-newca
984263bc 217.Ve
8b0cefbb
JR
218.PP
219Complete certificate creation example: create a \s-1CA\s0, create a request, sign
984263bc
MD
220the request and finally create a PKCS#12 file containing it.
221.PP
222.Vb 4
e257b235
PA
223\& CA.pl \-newca
224\& CA.pl \-newreq
225\& CA.pl \-signreq
226\& CA.pl \-pkcs12 "My Test Certificate"
984263bc
MD
227.Ve
228.SH "DSA CERTIFICATES"
8b0cefbb
JR
229.IX Header "DSA CERTIFICATES"
230Although the \fB\s-1CA\s0.pl\fR creates \s-1RSA\s0 CAs and requests it is still possible to
231use it with \s-1DSA\s0 certificates and requests using the \fIreq\fR\|(1) command
984263bc
MD
232directly. The following example shows the steps that would typically be taken.
233.PP
8b0cefbb 234Create some \s-1DSA\s0 parameters:
984263bc
MD
235.PP
236.Vb 1
e257b235 237\& openssl dsaparam \-out dsap.pem 1024
984263bc 238.Ve
8b0cefbb
JR
239.PP
240Create a \s-1DSA\s0 \s-1CA\s0 certificate and private key:
984263bc
MD
241.PP
242.Vb 1
e257b235 243\& openssl req \-x509 \-newkey dsa:dsap.pem \-keyout cacert.pem \-out cacert.pem
984263bc 244.Ve
8b0cefbb
JR
245.PP
246Create the \s-1CA\s0 directories and files:
984263bc
MD
247.PP
248.Vb 1
e257b235 249\& CA.pl \-newca
984263bc 250.Ve
984263bc 251.PP
8b0cefbb
JR
252enter cacert.pem when prompted for the \s-1CA\s0 file name.
253.PP
254Create a \s-1DSA\s0 certificate request and private key (a different set of parameters
984263bc
MD
255can optionally be created first):
256.PP
257.Vb 1
e257b235 258\& openssl req \-out newreq.pem \-newkey dsa:dsap.pem
984263bc 259.Ve
8b0cefbb 260.PP
984263bc
MD
261Sign the request:
262.PP
263.Vb 1
e257b235 264\& CA.pl \-signreq
984263bc
MD
265.Ve
266.SH "NOTES"
8b0cefbb
JR
267.IX Header "NOTES"
268Most of the filenames mentioned can be modified by editing the \fB\s-1CA\s0.pl\fR script.
984263bc
MD
269.PP
270If the demoCA directory already exists then the \fB\-newca\fR command will not
271overwrite it and will do nothing. This can happen if a previous call using
272the \fB\-newca\fR option terminated abnormally. To get the correct behaviour
273delete the demoCA directory if it already exists.
274.PP
8b0cefbb 275Under some environments it may not be possible to run the \fB\s-1CA\s0.pl\fR script
984263bc
MD
276directly (for example Win32) and the default configuration file location may
277be wrong. In this case the command:
278.PP
279.Vb 1
e257b235 280\& perl \-S CA.pl
984263bc 281.Ve
8b0cefbb
JR
282.PP
283can be used and the \fB\s-1OPENSSL_CONF\s0\fR environment variable changed to point to
984263bc
MD
284the correct path of the configuration file \*(L"openssl.cnf\*(R".
285.PP
286The script is intended as a simple front end for the \fBopenssl\fR program for use
287by a beginner. Its behaviour isn't always what is wanted. For more control over the
288behaviour of the certificate commands call the \fBopenssl\fR command directly.
289.SH "ENVIRONMENT VARIABLES"
8b0cefbb
JR
290.IX Header "ENVIRONMENT VARIABLES"
291The variable \fB\s-1OPENSSL_CONF\s0\fR if defined allows an alternative configuration
984263bc
MD
292file location to be specified, it should contain the full path to the
293configuration file, not just its directory.
294.SH "SEE ALSO"
e3cdf75b 295.IX Header "SEE ALSO"
8b0cefbb
JR
296\&\fIx509\fR\|(1), \fIca\fR\|(1), \fIreq\fR\|(1), \fIpkcs12\fR\|(1),
297\&\fIconfig\fR\|(5)