1CA.PL(1) OpenSSL CA.PL(1)
2
3
4
6 CA.pl - friendlier interface for OpenSSL certificate programs
7
9 CA.pl [-?] [-h] [-help] [-newcert] [-newreq] [-newreq-nodes] [-newca]
10 [-xsign] [-sign] [-signreq] [-signcert] [-verify] [files]
11
13 The CA.pl script is a perl script that supplies the relevant command
14 line arguments to the openssl command for some common certificate
15 operations. It is intended to simplify the process of certificate
16 creation and management by the use of some simple options.
17
19 ?, -h, -help
20 prints a usage message.
21
22 -newcert
23 creates a new self signed certificate. The private key and
24 certificate are written to the file "newreq.pem".
25
26 -newreq
27 creates a new certificate request. The private key and request are
28 written to the file "newreq.pem".
29
30 -newreq-nodes
31 is like -newreq except that the private key will not be encrypted.
32
33 -newca
34 creates a new CA hierarchy for use with the ca program (or the
35 -signcert and -xsign options). The user is prompted to enter the
36 filename of the CA certificates (which should also contain the
37 private key) or by hitting ENTER details of the CA will be prompted
38 for. The relevant files and directories are created in a directory
39 called "demoCA" in the current directory.
40
41 -pkcs12
42 create a PKCS#12 file containing the user certificate, private key
43 and CA certificate. It expects the user certificate and private key
44 to be in the file "newcert.pem" and the CA certificate to be in the
45 file demoCA/cacert.pem, it creates a file "newcert.p12". This
46 command can thus be called after the -sign option. The PKCS#12 file
47 can be imported directly into a browser. If there is an additional
48 argument on the command line it will be used as the "friendly name"
49 for the certificate (which is typically displayed in the browser
50 list box), otherwise the name "My Certificate" is used.
51
52 -sign, -signreq, -xsign
53 calls the ca program to sign a certificate request. It expects the
54 request to be in the file "newreq.pem". The new certificate is
55 written to the file "newcert.pem" except in the case of the -xsign
56 option when it is written to standard output.
57
58 -signCA
59 this option is the same as the -signreq option except it uses the
60 configuration file section v3_ca and so makes the signed request a
61 valid CA certificate. This is useful when creating intermediate CA
62 from a root CA.
63
64 -signcert
65 this option is the same as -sign except it expects a self signed
66 certificate to be present in the file "newreq.pem".
67
68 -verify
69 verifies certificates against the CA certificate for "demoCA". If
70 no certificates are specified on the command line it tries to
71 verify the file "newcert.pem".
72
73 files
74 one or more optional certificate file names for use with the
75 -verify command.
76
78 Create a CA hierarchy:
79
80 CA.pl -newca
81
82 Complete certificate creation example: create a CA, create a request,
83 sign the request and finally create a PKCS#12 file containing it.
84
85 CA.pl -newca
86 CA.pl -newreq
87 CA.pl -signreq
88 CA.pl -pkcs12 "My Test Certificate"
89
91 Although the CA.pl creates RSA CAs and requests it is still possible to
92 use it with DSA certificates and requests using the req(1) command
93 directly. The following example shows the steps that would typically be
94 taken.
95
96 Create some DSA parameters:
97
98 openssl dsaparam -out dsap.pem 1024
99
100 Create a DSA CA certificate and private key:
101
102 openssl req -x509 -newkey dsa:dsap.pem -keyout cacert.pem -out cacert.pem
103
104 Create the CA directories and files:
105
106 CA.pl -newca
107
108 enter cacert.pem when prompted for the CA file name.
109
110 Create a DSA certificate request and private key (a different set of
111 parameters can optionally be created first):
112
113 openssl req -out newreq.pem -newkey dsa:dsap.pem
114
115 Sign the request:
116
117 CA.pl -signreq
118
120 Most of the filenames mentioned can be modified by editing the CA.pl
121 script.
122
123 If the demoCA directory already exists then the -newca command will not
124 overwrite it and will do nothing. This can happen if a previous call
125 using the -newca option terminated abnormally. To get the correct
126 behaviour delete the demoCA directory if it already exists.
127
128 Under some environments it may not be possible to run the CA.pl script
129 directly (for example Win32) and the default configuration file
130 location may be wrong. In this case the command:
131
132 perl -S CA.pl
133
134 can be used and the OPENSSL_CONF environment variable changed to point
135 to the correct path of the configuration file "openssl.cnf".
136
137 The script is intended as a simple front end for the openssl program
138 for use by a beginner. Its behaviour isn't always what is wanted. For
139 more control over the behaviour of the certificate commands call the
140 openssl command directly.
141
143 The variable OPENSSL_CONF if defined allows an alternative
144 configuration file location to be specified, it should contain the full
145 path to the configuration file, not just its directory.
146
148 x509(1), ca(1), req(1), pkcs12(1), config(5)
149
150
151
1521.0.0e 2005-05-03 CA.PL(1)