]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man1/CA.pl.pod
There is no -signreq option in CA.pl
[thirdparty/openssl.git] / doc / man1 / CA.pl.pod
CommitLineData
2af9fd00
DSH
1=pod
2
3=head1 NAME
4
5CA.pl - friendlier interface for OpenSSL certificate programs
6
7=head1 SYNOPSIS
8
9B<CA.pl>
022696ca 10B<-?> |
11B<-h> |
12B<-help>
13
14B<CA.pl>
15B<-newcert> |
16B<-newreq> |
17B<-newreq-nodes> |
18B<-xsign> |
19B<-sign> |
20B<-signCA> |
21B<-signcert> |
22B<-crl> |
23B<-newca>
cab33afb 24[B<-extra-I<cmd>> I<parameter>]
022696ca 25
cab33afb 26B<CA.pl> B<-pkcs12> [B<-extra-pkcs12> I<parameter>] [I<certname>]
022696ca 27
cab33afb 28B<CA.pl> B<-verify> [B<-extra-verify> I<parameter>] I<certfile> ...
022696ca 29
cab33afb 30B<CA.pl> B<-revoke> [B<-extra-ca> I<parameter>] I<certfile> [I<reason>]
2af9fd00 31
3dfda1a6
RS
32=head1 DESCRIPTION
33
2af9fd00 34The B<CA.pl> script is a perl script that supplies the relevant command line
35a810bb 35arguments to the L<openssl(1)> command for some common certificate operations.
2af9fd00
DSH
36It is intended to simplify the process of certificate creation and management
37by the use of some simple options.
38
cab33afb
RS
39The script is intended as a simple front end for the L<openssl(1)> program for
40use by a beginner. Its behaviour isn't always what is wanted. For more control
41over the behaviour of the certificate commands call the L<openssl(1)> command
42directly.
43
44Most of the filenames mentioned below can be modified by editing the
45B<CA.pl> script.
46
47Under some environments it may not be possible to run the B<CA.pl> script
48directly (for example Win32) and the default configuration file location may
49be wrong. In this case the command:
50
51 perl -S CA.pl
52
53can be used and the B<OPENSSL_CONF> environment variable can be set to point to
54the correct path of the configuration file.
55
3dfda1a6 56=head1 OPTIONS
2af9fd00
DSH
57
58=over 4
59
60=item B<?>, B<-h>, B<-help>
61
c4de074e 62Prints a usage message.
2af9fd00
DSH
63
64=item B<-newcert>
65
c4de074e 66Creates a new self signed certificate. The private key is written to the file
1948394d 67F<newkey.pem> and the request written to the file F<newreq.pem>.
8bc93d2f 68Invokes L<openssl-req(1)>.
2af9fd00
DSH
69
70=item B<-newreq>
71
c4de074e 72Creates a new certificate request. The private key is written to the file
1948394d 73F<newkey.pem> and the request written to the file F<newreq.pem>.
8bc93d2f 74Executes L<openssl-req(1)> under the hood.
2af9fd00 75
9b623183 76=item B<-newreq-nodes>
d199858e 77
c4de074e 78Is like B<-newreq> except that the private key will not be encrypted.
8bc93d2f 79Uses L<openssl-req(1)>.
d199858e 80
2af9fd00
DSH
81=item B<-newca>
82
c4de074e 83Creates a new CA hierarchy for use with the B<ca> program (or the B<-signcert>
2af9fd00
DSH
84and B<-xsign> options). The user is prompted to enter the filename of the CA
85certificates (which should also contain the private key) or by hitting ENTER
86details of the CA will be prompted for. The relevant files and directories
1948394d 87are created in a directory called F<demoCA> in the current directory.
8bc93d2f 88Uses L<openssl-req(1)> and L<openssl-ca(1)>.
2af9fd00 89
cab33afb
RS
90If the F<demoCA> directory already exists then the B<-newca> command will not
91overwrite it and will do nothing. This can happen if a previous call using
92the B<-newca> option terminated abnormally. To get the correct behaviour
93delete the directory if it already exists.
94
2af9fd00
DSH
95=item B<-pkcs12>
96
c4de074e 97Create a PKCS#12 file containing the user certificate, private key and CA
2af9fd00 98certificate. It expects the user certificate and private key to be in the
1948394d
RL
99file F<newcert.pem> and the CA certificate to be in the file F<demoCA/cacert.pem>,
100it creates a file F<newcert.p12>. This command can thus be called after the
2af9fd00
DSH
101B<-sign> option. The PKCS#12 file can be imported directly into a browser.
102If there is an additional argument on the command line it will be used as the
103"friendly name" for the certificate (which is typically displayed in the browser
657e60fa 104list box), otherwise the name "My Certificate" is used.
8bc93d2f 105Delegates work to L<openssl-pkcs12(1)>.
2af9fd00 106
022696ca 107=item B<-sign>, B<-signcert>, B<-xsign>
2af9fd00 108
35a810bb 109Calls the L<openssl-ca(1)> command to sign a certificate request. It expects the
1948394d
RL
110request to be in the file F<newreq.pem>. The new certificate is written to the
111file F<newcert.pem> except in the case of the B<-xsign> option when it is
8bc93d2f 112written to standard output.
d428bf8c
DSH
113
114=item B<-signCA>
115
e1c6f762 116This option is the same as the B<-sign> option except it uses the
c4de074e
P
117configuration file section B<v3_ca> and so makes the signed request a
118valid CA certificate. This is useful when creating intermediate CA from
8bc93d2f 119a root CA. Extra params are passed to L<openssl-ca(1)>.
d428bf8c 120
2af9fd00
DSH
121=item B<-signcert>
122
c4de074e 123This option is the same as B<-sign> except it expects a self signed certificate
1948394d 124to be present in the file F<newreq.pem>.
8bc93d2f 125Extra params are passed to L<openssl-x509(1)> and L<openssl-ca(1)>.
2af9fd00 126
e8185aea
RS
127=item B<-crl>
128
8bc93d2f 129Generate a CRL. Executes L<openssl-ca(1)>.
e8185aea 130
e8769719 131=item B<-revoke> I<certfile> [I<reason>]
e8185aea 132
c4de074e 133Revoke the certificate contained in the specified B<certfile>. An optional
e8185aea
RS
134reason may be specified, and must be one of: B<unspecified>,
135B<keyCompromise>, B<CACompromise>, B<affiliationChanged>, B<superseded>,
136B<cessationOfOperation>, B<certificateHold>, or B<removeFromCRL>.
8bc93d2f 137Leverages L<openssl-ca(1)>.
e8185aea 138
2af9fd00
DSH
139=item B<-verify>
140
1948394d 141Verifies certificates against the CA certificate for F<demoCA>. If no
c4de074e 142certificates are specified on the command line it tries to verify the file
8bc93d2f 143F<newcert.pem>. Invokes L<openssl-verify(1)>.
2af9fd00 144
cab33afb 145=item B<-extra-I<cmd>> I<parameter>
3dfda1a6 146
cab33afb 147For each option B<extra-I<cmd>>, pass I<parameter> to the L<openssl(1)>
b2bdfb63 148sub-command with the same name as I<cmd>, if that sub-command is invoked.
cab33afb 149For example, if L<openssl-req(1)> is invoked, the I<parameter> given with
b2bdfb63 150B<-extra-req> will be passed to it.
cab33afb
RS
151For multi-word parameters, either repeat the option or quote the I<parameters>
152so it looks like one word to your shell.
153See the individual command documentation for more information.
3dfda1a6 154
2af9fd00
DSH
155=back
156
157=head1 EXAMPLES
158
159Create a CA hierarchy:
160
161 CA.pl -newca
162
163Complete certificate creation example: create a CA, create a request, sign
164the request and finally create a PKCS#12 file containing it.
165
166 CA.pl -newca
167 CA.pl -newreq
e1c6f762 168 CA.pl -sign
2af9fd00
DSH
169 CA.pl -pkcs12 "My Test Certificate"
170
a8055c70
RS
171=head1 ENVIRONMENT
172
cab33afb
RS
173The environment variable B<OPENSSL> may be used to specify the name of
174the OpenSSL program. It can be a full pathname, or a relative one.
175
a8055c70
RS
176The environment variable B<OPENSSL_CONFIG> may be used to specify a
177configuration option and value to the B<req> and B<ca> commands invoked by
178this script. It's value should be the option and pathname, as in
179C<-config /path/to/conf-file>.
180
2af9fd00
DSH
181=head1 SEE ALSO
182
b6b66573
DMSP
183L<openssl(1)>,
184L<openssl-x509(1)>,
185L<openssl-ca(1)>,
186L<openssl-req(1)>,
187L<openssl-pkcs12(1)>,
9b86974e 188L<config(5)>
2af9fd00 189
e2f92610
RS
190=head1 COPYRIGHT
191
33388b44 192Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 193
449040b4 194Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
195this file except in compliance with the License. You can obtain a copy
196in the file LICENSE in the source distribution or at
197L<https://www.openssl.org/source/license.html>.
198
199=cut