]>
Commit | Line | Data |
---|---|---|
8d9a4d83 DDO |
1 | =pod |
2 | {- OpenSSL::safe::output_do_not_edit_headers(); -} | |
3 | ||
4 | =head1 NAME | |
5 | ||
d99c8667 | 6 | openssl-cmp - Certificate Management Protocol (CMP, RFC 4210) application |
8d9a4d83 DDO |
7 | |
8 | =head1 SYNOPSIS | |
9 | ||
10 | B<openssl> B<cmp> | |
11 | [B<-help>] | |
12 | [B<-config> I<filename>] | |
13 | [B<-section> I<names>] | |
d99c8667 | 14 | [B<-verbosity> I<level>] |
8d9a4d83 | 15 | |
d99c8667 | 16 | Generic message options: |
8d9a4d83 | 17 | |
d99c8667 | 18 | [B<-cmd> I<i r|cr|kur|p10cr|rr|genm>] |
8d9a4d83 DDO |
19 | [B<-infotype> I<name>] |
20 | [B<-geninfo> I<OID:int:N>] | |
21 | ||
d99c8667 DDO |
22 | Certificate enrollment options: |
23 | ||
f91d003a | 24 | [B<-newkey> I<filename>|I<uri>] |
8d9a4d83 DDO |
25 | [B<-newkeypass> I<arg>] |
26 | [B<-subject> I<name>] | |
27 | [B<-issuer> I<name>] | |
28 | [B<-days> I<number>] | |
29 | [B<-reqexts> I<name>] | |
30 | [B<-sans> I<spec>] | |
31 | [B<-san_nodefault>] | |
32 | [B<-policies> I<name>] | |
33 | [B<-policy_oids> I<names>] | |
34 | [B<-policy_oids_critical>] | |
35 | [B<-popo> I<number>] | |
36 | [B<-csr> I<filename>] | |
3d46c81a | 37 | [B<-out_trusted> I<filenames>|I<uris>] |
8d9a4d83 DDO |
38 | [B<-implicit_confirm>] |
39 | [B<-disable_confirm>] | |
40 | [B<-certout> I<filename>] | |
39082af2 | 41 | [B<-chainout> I<filename>] |
8d9a4d83 | 42 | |
d99c8667 DDO |
43 | Certificate enrollment and revocation options: |
44 | ||
3d46c81a | 45 | [B<-oldcert> I<filename>|I<uri>] |
8d9a4d83 DDO |
46 | [B<-revreason> I<number>] |
47 | ||
d99c8667 DDO |
48 | Message transfer options: |
49 | ||
50 | [B<-server> I<[http[s]://]address[:port][/path]>] | |
51 | [B<-path> I<remote_path>] | |
52 | [B<-proxy> I<[http[s]://]address[:port][/path]>] | |
53 | [B<-no_proxy> I<addresses>] | |
54 | [B<-msg_timeout> I<seconds>] | |
55 | [B<-total_timeout> I<seconds>] | |
56 | ||
57 | Server authentication options: | |
58 | ||
3d46c81a | 59 | [B<-trusted> I<filenames>|I<uris>] |
d99c8667 | 60 | [B<-untrusted> I<sources>] |
3d46c81a | 61 | [B<-srvcert> I<filename>|I<uri>] |
d99c8667 DDO |
62 | [B<-recipient> I<name>] |
63 | [B<-expect_sender> I<name>] | |
64 | [B<-ignore_keyusage>] | |
65 | [B<-unprotected_errors>] | |
66 | [B<-extracertsout> I<filename>] | |
67 | [B<-cacertsout> I<filename>] | |
68 | ||
69 | Client authentication options: | |
70 | ||
71 | [B<-ref> I<value>] | |
72 | [B<-secret> I<arg>] | |
3d46c81a DDO |
73 | [B<-cert> I<filename>|I<uri>] |
74 | [B<-own_trusted> I<filenames>|I<uris>] | |
75 | [B<-key> I<filename>|I<uri>] | |
d99c8667 DDO |
76 | [B<-keypass> I<arg>] |
77 | [B<-digest> I<name>] | |
78 | [B<-mac> I<name>] | |
79 | [B<-extracerts> I<sources>] | |
80 | [B<-unprotected_requests>] | |
81 | ||
82 | Credentials format options: | |
83 | ||
8d9a4d83 DDO |
84 | [B<-certform> I<PEM|DER>] |
85 | [B<-keyform> I<PEM|DER|P12|ENGINE>] | |
8d9a4d83 | 86 | [B<-otherpass> I<arg>] |
d99c8667 DDO |
87 | {- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -} |
88 | ||
89 | TLS connection options: | |
8d9a4d83 DDO |
90 | |
91 | [B<-tls_used>] | |
3d46c81a | 92 | [B<-tls_cert> I<filename>|I<uri>] |
f91d003a | 93 | [B<-tls_key> I<filename>|I<uri>] |
8d9a4d83 | 94 | [B<-tls_keypass> I<arg>] |
3d46c81a DDO |
95 | [B<-tls_extra> I<filenames>|I<uris>] |
96 | [B<-tls_trusted> I<filenames>|I<uris>] | |
8d9a4d83 DDO |
97 | [B<-tls_host> I<name>] |
98 | ||
d99c8667 DDO |
99 | Client-side debugging options: |
100 | ||
8d9a4d83 DDO |
101 | [B<-batch>] |
102 | [B<-repeat> I<number>] | |
103 | [B<-reqin>] I<filenames> | |
143be474 | 104 | [B<-reqin_new_tid>] |
8d9a4d83 DDO |
105 | [B<-reqout>] I<filenames> |
106 | [B<-rspin>] I<filenames> | |
107 | [B<-rspout>] I<filenames> | |
108 | [B<-use_mock_srv>] | |
109 | ||
d99c8667 DDO |
110 | Mock server options: |
111 | ||
112 | [B<-port> I<number>] | |
113 | [B<-max_msgs> I<number>] | |
114 | [B<-srv_ref> I<value>] | |
115 | [B<-srv_secret> I<arg>] | |
3d46c81a DDO |
116 | [B<-srv_cert> I<filename>|I<uri>] |
117 | [B<-srv_key> I<filename>|I<uri>] | |
d99c8667 | 118 | [B<-srv_keypass> I<arg>] |
3d46c81a DDO |
119 | [B<-srv_trusted> I<filenames>|I<uris>] |
120 | [B<-srv_untrusted> I<filenames>|I<uris>] | |
121 | [B<-rsp_cert> I<filename>|I<uri>] | |
122 | [B<-rsp_extracerts> I<filenames>|I<uris>] | |
123 | [B<-rsp_capubs> I<filenames>|I<uris>] | |
d99c8667 DDO |
124 | [B<-poll_count> I<number>] |
125 | [B<-check_after> I<number>] | |
126 | [B<-grant_implicitconf>] | |
127 | [B<-pkistatus> I<number>] | |
128 | [B<-failure> I<number>] | |
129 | [B<-failurebits> I<number>] | |
130 | [B<-statusstring> I<arg>] | |
131 | [B<-send_error>] | |
132 | [B<-send_unprotected>] | |
133 | [B<-send_unprot_err>] | |
134 | [B<-accept_unprotected>] | |
135 | [B<-accept_unprot_err>] | |
136 | [B<-accept_raverified>] | |
137 | ||
138 | Certificate verification options, for both CMP and TLS: | |
139 | ||
acb934ff | 140 | {- $OpenSSL::safe::opt_v_synopsis -} |
8d9a4d83 | 141 | |
f91d003a RL |
142 | =for openssl ifdef engine |
143 | ||
8d9a4d83 DDO |
144 | =head1 DESCRIPTION |
145 | ||
146 | The B<cmp> command is a client implementation for the Certificate | |
147 | Management Protocol (CMP) as defined in RFC4210. | |
148 | It can be used to request certificates from a CA server, | |
149 | update their certificates, | |
8b22c283 | 150 | request certificates to be revoked, and perform other types of CMP requests. |
8d9a4d83 DDO |
151 | |
152 | =head1 OPTIONS | |
153 | ||
154 | =over 4 | |
155 | ||
156 | =item B<-help> | |
157 | ||
158 | Display a summary of all options | |
159 | ||
160 | =item B<-config> I<filename> | |
161 | ||
162 | Configuration file to use. | |
163 | An empty string C<""> means none. | |
164 | Default filename is from the environment variable C<OPENSSL_CONF>. | |
165 | ||
166 | =item B<-section> I<names> | |
167 | ||
168 | Section(s) to use within config file defining CMP options. | |
169 | An empty string C<""> means no specific section. | |
170 | Default is C<cmp>. | |
b434b2c0 | 171 | |
8d9a4d83 DDO |
172 | Multiple section names may be given, separated by commas and/or whitespace |
173 | (where in the latter case the whole argument must be enclosed in "..."). | |
174 | Contents of sections named later may override contents of sections named before. | |
175 | In any case, as usual, the C<[default]> section and finally the unnamed | |
176 | section (as far as present) can provide per-option fallback values. | |
177 | ||
d99c8667 | 178 | =item B<-verbosity> I<level> |
8d9a4d83 | 179 | |
d99c8667 DDO |
180 | Level of verbosity for logging, error output, etc. |
181 | 0 = EMERG, 1 = ALERT, 2 = CRIT, 3 = ERR, 4 = WARN, 5 = NOTE, | |
182 | 6 = INFO, 7 = DEBUG, 8 = TRACE. | |
183 | Defaults to 6 = INFO. | |
184 | ||
185 | =back | |
8d9a4d83 DDO |
186 | |
187 | =head2 Generic message options | |
188 | ||
189 | =over 4 | |
190 | ||
191 | =item B<-cmd> I<ir|cr|kur|p10cr|rr|genm> | |
192 | ||
193 | CMP command to execute. | |
194 | Currently implemented commands are: | |
195 | ||
196 | =over 8 | |
197 | ||
198 | =item ir E<nbsp> - Initialization Request | |
199 | ||
200 | =item cr E<nbsp> - Certificate Request | |
201 | ||
202 | =item p10cr - PKCS#10 Certification Request (for legacy support) | |
203 | ||
204 | =item kur E<nbsp>E<nbsp>- Key Update Request | |
205 | ||
206 | =item rr E<nbsp> - Revocation Request | |
207 | ||
208 | =item genm - General Message | |
209 | ||
210 | =back | |
211 | ||
8b22c283 DDO |
212 | B<ir> requests initialization of an End Entity into a PKI hierarchy |
213 | by issuing a first certificate. | |
8d9a4d83 | 214 | |
8b22c283 | 215 | B<cr> requests issuing an additional certificate for an End Entity already |
8d9a4d83 DDO |
216 | initialized to the PKI hierarchy. |
217 | ||
8b22c283 | 218 | B<p10cr> requests issuing an additional certificate similarly to B<cr> |
3d46c81a | 219 | but using PKCS#10 CSR format. |
8d9a4d83 | 220 | |
5e128ed1 | 221 | B<kur> requests a (key) update for an existing certificate. |
8d9a4d83 | 222 | |
5e128ed1 | 223 | B<rr> requests revocation of an existing certificate. |
8d9a4d83 DDO |
224 | |
225 | B<genm> requests information using a General Message, where optionally | |
226 | included B<InfoTypeAndValue>s may be used to state which info is of interest. | |
227 | Upon receipt of the General Response, information about all received | |
228 | ITAV B<infoType>s is printed to stdout. | |
229 | ||
230 | =item B<-infotype> I<name> | |
231 | ||
232 | Set InfoType name to use for requesting specific info in B<genm>, | |
233 | e.g., C<signKeyPairTypes>. | |
234 | ||
235 | =item B<-geninfo> I<OID:int:N> | |
236 | ||
237 | generalInfo integer values to place in request PKIHeader with given OID, | |
5ea4c6e5 | 238 | e.g., C<1.2.3.4:int:56789>. |
8d9a4d83 DDO |
239 | |
240 | =back | |
241 | ||
d99c8667 | 242 | =head2 Certificate enrollment options |
8d9a4d83 DDO |
243 | |
244 | =over 4 | |
245 | ||
f91d003a | 246 | =item B<-newkey> I<filename>|I<uri> |
8d9a4d83 | 247 | |
f91d003a | 248 | The source of the private or public key for the certificate requested |
8d9a4d83 DDO |
249 | in Initialization Request (IR), Certification Request(CR), or |
250 | Key Update Request (KUR). | |
251 | Default is the public key in the PKCS#10 CSR given with the B<-csr> option, | |
252 | if any, or else the current client key, if given. | |
253 | ||
254 | =item B<-newkeypass> I<arg> | |
255 | ||
256 | Pass phrase source for the key given with the B<-newkey> option. | |
257 | If not given here, the password will be prompted for if needed. | |
258 | ||
fee0af08 RL |
259 | For more information about the format of B<arg> see |
260 | L<openssl-passphrase-options(1)>. | |
8d9a4d83 DDO |
261 | |
262 | =item B<-subject> I<name> | |
263 | ||
264 | X509 Distinguished Name (DN) of subject to use in the requested certificate | |
265 | template. | |
3d46c81a DDO |
266 | For KUR, it defaults to the subject DN of any given CSR |
267 | or of the reference certificate (see B<-oldcert>) if provided. | |
8d9a4d83 DDO |
268 | This default is used for IR and CR only if no SANs are set. |
269 | ||
3d46c81a | 270 | The provided subject DN is also used as fallback sender of outgoing CMP messages |
0d17c2f4 | 271 | if no B<-cert> and no B<-oldcert> are given. |
8d9a4d83 | 272 | |
5a0991d0 DDO |
273 | The argument must be formatted as I</type0=value0/type1=value1/type2=...>. |
274 | Special characters may be escaped by C<\> (backslash), whitespace is retained. | |
275 | Empty values are permitted, but the corresponding type will not be included. | |
276 | Giving a single C</> will lead to an empty sequence of RDNs (a NULL-DN). | |
277 | Multi-valued RDNs can be formed by placing a C<+> character instead of a C</> | |
278 | between the AttributeValueAssertions (AVAs) that specify the members of the set. | |
279 | Example: | |
280 | ||
281 | C</DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe> | |
282 | ||
8d9a4d83 DDO |
283 | =item B<-issuer> I<name> |
284 | ||
285 | X509 issuer Distinguished Name (DN) of the CA server | |
286 | to place in the requested certificate template in IR/CR/KUR. | |
287 | ||
8d9a4d83 DDO |
288 | If neither B<-srvcert> nor B<-recipient> is available, |
289 | the name given in this option is also set as the recipient of the CMP message. | |
290 | ||
291 | =item B<-days> I<number> | |
292 | ||
293 | Number of days the new certificate is requested to be valid for, counting from | |
294 | the current time of the host. | |
295 | Also triggers the explicit request that the | |
296 | validity period starts from the current time (as seen by the host). | |
297 | ||
298 | =item B<-reqexts> I<name> | |
299 | ||
300 | Name of section in OpenSSL config file defining certificate request extensions. | |
b51bed05 DDO |
301 | If the B<-csr> option is present, these extensions augment the extensions |
302 | contained the given PKCS#10 CSR, overriding any extensions with same OIDs. | |
8d9a4d83 DDO |
303 | |
304 | =item B<-sans> I<spec> | |
305 | ||
306 | One or more IP addresses, DNS names, or URIs separated by commas or whitespace | |
307 | (where in the latter case the whole argument must be enclosed in "...") | |
308 | to add as Subject Alternative Name(s) (SAN) certificate request extension. | |
309 | If the special element "critical" is given the SANs are flagged as critical. | |
310 | Cannot be used if any Subject Alternative Name extension is set via B<-reqexts>. | |
311 | ||
312 | =item B<-san_nodefault> | |
313 | ||
314 | When Subject Alternative Names are not given via B<-sans> | |
315 | nor defined via B<-reqexts>, | |
316 | they are copied by default from the reference certificate (see B<-oldcert>). | |
317 | This can be disabled by giving the B<-san_nodefault> option. | |
318 | ||
319 | =item B<-policies> I<name> | |
320 | ||
321 | Name of section in OpenSSL config file defining policies to be set | |
322 | as certificate request extension. | |
323 | This option cannot be used together with B<-policy_oids>. | |
324 | ||
325 | =item B<-policy_oids> I<names> | |
326 | ||
327 | One or more OID(s), separated by commas and/or whitespace | |
328 | (where in the latter case the whole argument must be enclosed in "...") | |
329 | to add as certificate policies request extension. | |
330 | This option cannot be used together with B<-policies>. | |
331 | ||
332 | =item B<-policy_oids_critical> | |
333 | ||
334 | Flag the policies given with B<-policy_oids> as critical. | |
335 | ||
336 | =item B<-popo> I<number> | |
337 | ||
338 | Proof-of-Possession (POPO) method to use for IR/CR/KUR; values: C<-1>..<2> where | |
339 | C<-1> = NONE, C<0> = RAVERIFIED, C<1> = SIGNATURE (default), C<2> = KEYENC. | |
340 | ||
341 | Note that a signature-based POPO can only be produced if a private key | |
342 | is provided via the B<-newkey> or B<-key> options. | |
343 | ||
344 | =item B<-csr> I<filename> | |
345 | ||
3d46c81a | 346 | PKCS#10 CSR in PEM or DER format containing a certificate request. |
5e128ed1 DDO |
347 | With B<-cmd> I<p10cr> it is used directly in a legacy P10CR message. |
348 | When used with B<-cmd> I<ir>, I<cr>, or I<kur>, it is transformed into the | |
3d46c81a | 349 | respective regular CMP request. |
5e128ed1 | 350 | It may also be used with B<-cmd> I<rr> to specify the certificate to be revoked |
3d46c81a | 351 | via the included subject and public key. |
8d9a4d83 | 352 | |
3d46c81a | 353 | =item B<-out_trusted> I<filenames>|I<uris> |
8d9a4d83 DDO |
354 | |
355 | Trusted certificate(s) to use for verifying the newly enrolled certificate. | |
356 | ||
3d46c81a | 357 | Multiple sources may be given, separated by commas and/or whitespace |
8d9a4d83 DDO |
358 | (where in the latter case the whole argument must be enclosed in "..."). |
359 | Each source may contain multiple certificates. | |
360 | ||
acb934ff DDO |
361 | The certificate verification options |
362 | B<-verify_hostname>, B<-verify_ip>, and B<-verify_email> | |
363 | only affect the certificate verification enabled via this option. | |
8d9a4d83 DDO |
364 | |
365 | =item B<-implicit_confirm> | |
366 | ||
367 | Request implicit confirmation of newly enrolled certificates. | |
368 | ||
369 | =item B<-disable_confirm> | |
370 | ||
371 | Do not send certificate confirmation message for newly enrolled certificate | |
372 | without requesting implicit confirmation | |
373 | to cope with broken servers not supporting implicit confirmation correctly. | |
374 | B<WARNING:> This leads to behavior violating RFC 4210. | |
375 | ||
376 | =item B<-certout> I<filename> | |
377 | ||
378 | The file where the newly enrolled certificate should be saved. | |
379 | ||
39082af2 DDO |
380 | =item B<-chainout> I<filename> |
381 | ||
382 | The file where the chain of the newly enrolled certificate should be saved. | |
383 | ||
8d9a4d83 DDO |
384 | =back |
385 | ||
d99c8667 | 386 | =head2 Certificate enrollment and revocation options |
8d9a4d83 DDO |
387 | |
388 | =over 4 | |
389 | ||
3d46c81a | 390 | =item B<-oldcert> I<filename>|I<uri>] |
8d9a4d83 DDO |
391 | |
392 | The certificate to be updated (i.e., renewed or re-keyed) in Key Update Request | |
393 | (KUR) messages or to be revoked in Revocation Request (RR) messages. | |
3d46c81a | 394 | For RR the certificate to be revoked can also be specified using B<-csr>. |
5e128ed1 DDO |
395 | For KUR the certificate to be updated defaults to B<-cert>, |
396 | and the resulting certificate is called I<reference certificate>. | |
8d9a4d83 | 397 | |
3d46c81a | 398 | The reference certificate, if any, is also used for |
d718521f | 399 | deriving default subject DN and Subject Alternative Names and the |
5e128ed1 | 400 | default issuer entry in the requested certificate template of an IR/CR/KUR. |
8b22c283 | 401 | Its subject is used as sender of outgoing messages if B<-cert> is not given. |
16931355 DDO |
402 | Its issuer is used as default recipient in CMP message headers |
403 | if neither B<-recipient>, B<-srvcert>, nor B<-issuer> is given. | |
8d9a4d83 DDO |
404 | |
405 | =item B<-revreason> I<number> | |
406 | ||
407 | Set CRLReason to be included in revocation request (RR); values: C<0>..C<10> | |
408 | or C<-1> for none (which is the default). | |
409 | ||
410 | Reason numbers defined in RFC 5280 are: | |
411 | ||
412 | CRLReason ::= ENUMERATED { | |
413 | unspecified (0), | |
414 | keyCompromise (1), | |
415 | cACompromise (2), | |
416 | affiliationChanged (3), | |
417 | superseded (4), | |
418 | cessationOfOperation (5), | |
419 | certificateHold (6), | |
420 | -- value 7 is not used | |
421 | removeFromCRL (8), | |
422 | privilegeWithdrawn (9), | |
423 | aACompromise (10) | |
424 | } | |
425 | ||
426 | =back | |
427 | ||
8d9a4d83 DDO |
428 | =head2 Message transfer options |
429 | ||
430 | =over 4 | |
431 | ||
d96486dc | 432 | =item B<-server> I<[http[s]://]address[:port][/path]> |
8d9a4d83 DDO |
433 | |
434 | The IP address or DNS hostname and optionally port (defaulting to 80 or 443) | |
435 | of the CMP server to connect to using HTTP(S) transport. | |
8b22c283 | 436 | The optional I<http://> or I<https://> prefix is ignored. |
d96486dc | 437 | If a path is included it provides the default value for the B<-path> option. |
8d9a4d83 | 438 | |
d99c8667 DDO |
439 | =item B<-path> I<remote_path> |
440 | ||
441 | HTTP path at the CMP server (aka CMP alias) to use for POST requests. | |
442 | Defaults to any path given with B<-server>, else C<"/">. | |
443 | ||
8d9a4d83 DDO |
444 | =item B<-proxy> I<[http[s]://]address[:port][/path]> |
445 | ||
446 | The HTTP(S) proxy server to use for reaching the CMP server unless B<no_proxy> | |
447 | applies, see below. | |
8b22c283 | 448 | The optional I<http://> or I<https://> prefix and any trailing path are ignored. |
8d9a4d83 DDO |
449 | Defaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY> |
450 | in case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>. | |
451 | ||
452 | =item B<-no_proxy> I<addresses> | |
6600baa9 | 453 | |
8d9a4d83 DDO |
454 | List of IP addresses and/or DNS names of servers |
455 | not to use an HTTP(S) proxy for, separated by commas and/or whitespace | |
456 | (where in the latter case the whole argument must be enclosed in "..."). | |
457 | Default is from the environment variable C<no_proxy> if set, else C<NO_PROXY>. | |
458 | ||
8d9a4d83 DDO |
459 | =item B<-msg_timeout> I<seconds> |
460 | ||
461 | Number of seconds (or 0 for infinite) a CMP request-response message round trip | |
462 | is allowed to take before a timeout error is returned. | |
463 | Default is 120. | |
464 | ||
465 | =item B<-total_timeout> I<seconds> | |
466 | ||
467 | Maximum number seconds an overall enrollment transaction may take, | |
468 | including attempts polling for certificates on C<waiting> PKIStatus. | |
469 | Default is 0 (infinite). | |
470 | ||
471 | =back | |
472 | ||
8d9a4d83 DDO |
473 | =head2 Server authentication options |
474 | ||
475 | =over 4 | |
476 | ||
3d46c81a | 477 | =item B<-trusted> I<filenames>|I<uris> |
8d9a4d83 DDO |
478 | |
479 | When verifying signature-based protection of CMP response messages, | |
480 | these are the CA certificate(s) to trust while checking certificate chains | |
481 | during CMP server authentication. | |
0d17c2f4 | 482 | This option gives more flexibility than the B<-srvcert> option because the |
acb934ff | 483 | server-side CMP signer certificate is not pinned but may be any certificate |
0d17c2f4 | 484 | for which a chain to one of the given trusted certificates can be constructed. |
8d9a4d83 | 485 | |
b434b2c0 DDO |
486 | If no B<-trusted>, B<-srvcert>, and B<-secret> option is given |
487 | then protected response messages from the server are not authenticated. | |
488 | ||
3d46c81a | 489 | Multiple sources may be given, separated by commas and/or whitespace |
8d9a4d83 DDO |
490 | (where in the latter case the whole argument must be enclosed in "..."). |
491 | Each source may contain multiple certificates. | |
492 | ||
acb934ff DDO |
493 | The certificate verification options |
494 | B<-verify_hostname>, B<-verify_ip>, and B<-verify_email> | |
495 | have no effect on the certificate verification enabled via this option. | |
496 | ||
8d9a4d83 DDO |
497 | =item B<-untrusted> I<sources> |
498 | ||
7a7d6b51 DDO |
499 | Non-trusted intermediate CA certificate(s). |
500 | Any extra certificates given with the B<-cert> option are appended to it. | |
501 | All these certificates may be useful for cert path construction | |
502 | for the CMP client certificate (to include in the extraCerts field of outgoing | |
503 | messages) and for the TLS client certificate (if TLS is enabled) | |
504 | as well as for chain building | |
8b22c283 | 505 | when verifying the CMP server certificate (checking signature-based |
7a7d6b51 | 506 | CMP message protection) and when verifying newly enrolled certificates. |
8d9a4d83 | 507 | |
3d46c81a | 508 | Multiple sources may be given, separated by commas and/or whitespace. |
8d9a4d83 DDO |
509 | Each file may contain multiple certificates. |
510 | ||
3d46c81a | 511 | =item B<-srvcert> I<filename>|I<uri>] |
8d9a4d83 | 512 | |
0d17c2f4 | 513 | The specific CMP server certificate to expect and directly trust (even if it is |
8d9a4d83 | 514 | expired) when verifying signature-based protection of CMP response messages. |
0d17c2f4 | 515 | May be set alternatively to the B<-trusted> option to pin the accepted server. |
8d9a4d83 | 516 | |
0d17c2f4 DDO |
517 | If set, the subject of the certificate is also used |
518 | as default value for the recipient of CMP requests | |
8b22c283 | 519 | and as default value for the expected sender of incoming CMP messages. |
8d9a4d83 DDO |
520 | |
521 | =item B<-recipient> I<name> | |
522 | ||
0d17c2f4 | 523 | Distinguished Name (DN) to use in the recipient field of CMP request messages, |
87d20a96 | 524 | i.e., the CMP server (usually the addressed CA). |
8d9a4d83 | 525 | |
0d17c2f4 DDO |
526 | The recipient field in the header of a CMP message is mandatory. |
527 | If not given explicitly the recipient is determined in the following order: | |
528 | the subject of the CMP server certificate given with the B<-srvcert> option, | |
529 | the B<-issuer> option, | |
530 | the issuer of the certificate given with the B<-oldcert> option, | |
531 | the issuer of the CMP client certificate (B<-cert> option), | |
532 | as far as any of those is present, else the NULL-DN as last resort. | |
8d9a4d83 DDO |
533 | |
534 | =item B<-expect_sender> I<name> | |
535 | ||
8b22c283 | 536 | Distinguished Name (DN) expected in the sender field of incoming CMP messages. |
0d17c2f4 | 537 | Defaults to the subject DN of the pinned B<-srvcert>, if any. |
8d9a4d83 | 538 | |
0d17c2f4 DDO |
539 | This can be used to make sure that only a particular entity is accepted as |
540 | CMP message signer, and attackers are not able to use arbitrary certificates | |
541 | of a trusted PKI hierarchy to fraudulently pose as a CMP server. | |
542 | Note that this option gives slightly more freedom than setting the B<-srvcert>, | |
543 | which pins the server to the holder of a particular certificate, while the | |
544 | expected sender name will continue to match after updates of the server cert. | |
8d9a4d83 DDO |
545 | |
546 | =item B<-ignore_keyusage> | |
547 | ||
548 | Ignore key usage restrictions in CMP signer certificates when verifying | |
549 | signature-based protection of incoming CMP messages, | |
550 | else C<digitalSignature> must be allowed for signer certificate. | |
551 | ||
552 | =item B<-unprotected_errors> | |
553 | ||
554 | Accept missing or invalid protection of negative responses from the server. | |
555 | This applies to the following message types and contents: | |
556 | ||
557 | =over 4 | |
558 | ||
559 | =item * error messages | |
560 | ||
561 | =item * negative certificate responses (IP/CP/KUP) | |
562 | ||
563 | =item * negative revocation responses (RP) | |
564 | ||
565 | =item * negative PKIConf messages | |
566 | ||
567 | =back | |
568 | ||
569 | B<WARNING:> This setting leads to unspecified behavior and it is meant | |
570 | exclusively to allow interoperability with server implementations violating | |
571 | RFC 4210, e.g.: | |
572 | ||
573 | =over 4 | |
574 | ||
575 | =item * section 5.1.3.1 allows exceptions from protecting only for special | |
576 | cases: | |
577 | "There MAY be cases in which the PKIProtection BIT STRING is deliberately not | |
578 | used to protect a message [...] because other protection, external to PKIX, will | |
579 | be applied instead." | |
580 | ||
581 | =item * section 5.3.21 is clear on ErrMsgContent: "The CA MUST always sign it | |
582 | with a signature key." | |
583 | ||
584 | =item * appendix D.4 shows PKIConf message having protection | |
585 | ||
586 | =back | |
587 | ||
588 | =item B<-extracertsout> I<filename> | |
589 | ||
bb30bce2 DDO |
590 | The file where to save all certificates contained in the extraCerts field |
591 | of the last received response message (except for pollRep and PKIConf). | |
8d9a4d83 DDO |
592 | |
593 | =item B<-cacertsout> I<filename> | |
594 | ||
bb30bce2 DDO |
595 | The file where to save any CA certificates contained in the caPubs field of |
596 | the last received certificate response (i.e., IP, CP, or KUP) message. | |
8d9a4d83 DDO |
597 | |
598 | =back | |
599 | ||
8d9a4d83 DDO |
600 | =head2 Client authentication options |
601 | ||
602 | =over 4 | |
603 | ||
604 | =item B<-ref> I<value> | |
605 | ||
606 | Reference number/string/value to use as fallback senderKID; this is required | |
607 | if no sender name can be determined from the B<-cert> or <-subject> options and | |
608 | is typically used when authenticating with pre-shared key (password-based MAC). | |
609 | ||
610 | =item B<-secret> I<arg> | |
611 | ||
ef2d3588 DDO |
612 | Prefer PBM-based message protection with given source of a secret value. |
613 | The secret is used for creating PBM-based protection of outgoing messages | |
614 | and (as far as needed) for verifying PBM-based protection of incoming messages. | |
8d9a4d83 | 615 | PBM stands for Password-Based Message Authentication Code. |
ef2d3588 | 616 | This takes precedence over the B<-cert> and B<-key> options. |
8d9a4d83 | 617 | |
fee0af08 RL |
618 | For more information about the format of B<arg> see |
619 | L<openssl-passphrase-options(1)>. | |
8d9a4d83 | 620 | |
3d46c81a | 621 | =item B<-cert> I<filename>|I<uri>] |
8d9a4d83 | 622 | |
15076c26 | 623 | The client's current CMP signer certificate. |
8d9a4d83 | 624 | Requires the corresponding key to be given with B<-key>. |
8b22c283 DDO |
625 | The subject of this certificate will be used as sender of outgoing CMP messages, |
626 | while the subject of B<-oldcert> or B<-subjectName> may provide fallback values. | |
d718521f DDO |
627 | The issuer of this certificate is used as one of the recipient fallback values |
628 | and as fallback issuer entry in the certificate template of IR/CR/KUR. | |
8d9a4d83 | 629 | When using signature-based message protection, this "protection certificate" |
ef2d3588 DDO |
630 | will be included first in the extraCerts field of outgoing messages |
631 | and the signature is done with the corresponding key. | |
8d9a4d83 DDO |
632 | In Initialization Request (IR) messages this can be used for authenticating |
633 | using an external entity certificate as defined in appendix E.7 of RFC 4210. | |
634 | For Key Update Request (KUR) messages this is also used as | |
635 | the certificate to be updated if the B<-oldcert> option is not given. | |
ef2d3588 DDO |
636 | If the file includes further certs, they are appended to the untrusted certs |
637 | because they typically constitute the chain of the client certificate, which | |
638 | is included in the extraCerts field in signature-protected request messages. | |
8d9a4d83 | 639 | |
3d46c81a | 640 | =item B<-own_trusted> I<filenames>|I<uris> |
15076c26 DDO |
641 | |
642 | If this list of certificates is provided then the chain built for | |
acb934ff DDO |
643 | the client-side CMP signer certificate given with the B<-cert> option |
644 | is verified using the given certificates as trust anchors. | |
15076c26 | 645 | |
3d46c81a | 646 | Multiple sources may be given, separated by commas and/or whitespace |
15076c26 DDO |
647 | (where in the latter case the whole argument must be enclosed in "..."). |
648 | Each source may contain multiple certificates. | |
649 | ||
acb934ff DDO |
650 | The certificate verification options |
651 | B<-verify_hostname>, B<-verify_ip>, and B<-verify_email> | |
652 | have no effect on the certificate verification enabled via this option. | |
653 | ||
3d46c81a | 654 | =item B<-key> I<filename>|I<uri>] |
8d9a4d83 DDO |
655 | |
656 | The corresponding private key file for the client's current certificate given in | |
657 | the B<-cert> option. | |
658 | This will be used for signature-based message protection unless | |
659 | the B<-secret> option indicating PBM or B<-unprotected_requests> is given. | |
660 | ||
661 | =item B<-keypass> I<arg> | |
662 | ||
663 | Pass phrase source for the private key given with the B<-key> option. | |
664 | Also used for B<-cert> and B<-oldcert> in case it is an encrypted PKCS#12 file. | |
665 | If not given here, the password will be prompted for if needed. | |
666 | ||
fee0af08 RL |
667 | For more information about the format of B<arg> see |
668 | L<openssl-passphrase-options(1)>. | |
8d9a4d83 DDO |
669 | |
670 | =item B<-digest> I<name> | |
671 | ||
672 | Specifies name of supported digest to use in RFC 4210's MSG_SIG_ALG | |
673 | and as the one-way function (OWF) in MSG_MAC_ALG. | |
674 | If applicable, this is used for message protection and | |
675 | Proof-of-Possession (POPO) signatures. | |
676 | To see the list of supported digests, use B<openssl list -digest-commands>. | |
677 | Defaults to C<sha256>. | |
678 | ||
679 | =item B<-mac> I<name> | |
680 | ||
681 | Specifies the name of the MAC algorithm in MSG_MAC_ALG. | |
682 | To get the names of supported MAC algorithms use B<openssl list -mac-algorithms> | |
683 | and possibly combine such a name with the name of a supported digest algorithm, | |
684 | e.g., hmacWithSHA256. | |
685 | Defaults to C<hmac-sha1> as per RFC 4210. | |
686 | ||
687 | =item B<-extracerts> I<sources> | |
688 | ||
689 | Certificates to append in the extraCerts field when sending messages. | |
a0745e2b | 690 | They can be used as the default CMP signer certificate chain to include. |
8d9a4d83 | 691 | |
3d46c81a | 692 | Multiple sources may be given, separated by commas and/or whitespace |
8d9a4d83 DDO |
693 | (where in the latter case the whole argument must be enclosed in "..."). |
694 | Each source may contain multiple certificates. | |
695 | ||
696 | =item B<-unprotected_requests> | |
697 | ||
698 | Send messages without CMP-level protection. | |
699 | ||
700 | =back | |
701 | ||
8d9a4d83 DDO |
702 | =head2 Credentials format options |
703 | ||
704 | =over 4 | |
705 | ||
706 | =item B<-certform> I<PEM|DER> | |
707 | ||
708 | File format to use when saving a certificate to a file. | |
709 | Default value is PEM. | |
710 | ||
b3c5aadf | 711 | =item B<-keyform> I<PEM|DER|P12|ENGINE> |
8d9a4d83 | 712 | |
b3c5aadf DDO |
713 | The format of the key input. |
714 | The only value with effect is B<ENGINE>. | |
f91d003a | 715 | See L<openssl(1)/Format Options> for details. |
8d9a4d83 DDO |
716 | |
717 | =item B<-otherpass> I<arg> | |
718 | ||
719 | Pass phrase source for certificate given with the B<-trusted>, B<-untrusted>, | |
7a7d6b51 DDO |
720 | B<-own_trusted>, B<-srvcert>, B<-out_trusted>, B<-extracerts>, |
721 | B<-srv_trusted>, B<-srv_untrusted>, B<-rsp_extracerts>, B<-rsp_capubs>, | |
722 | B<-tls_extra>, and B<-tls_trusted> options. | |
8d9a4d83 DDO |
723 | If not given here, the password will be prompted for if needed. |
724 | ||
fee0af08 RL |
725 | For more information about the format of B<arg> see |
726 | L<openssl-passphrase-options(1)>. | |
f91d003a RL |
727 | |
728 | {- $OpenSSL::safe::opt_engine_item -} | |
729 | ||
730 | =back | |
731 | ||
0f221d9c | 732 | {- output_off() if $disabled{"deprecated-3.0"}; "" -} |
f91d003a | 733 | As an alternative to using this combination: |
8d9a4d83 | 734 | |
f91d003a | 735 | -engine {engineid} -key {keyid} -keyform ENGINE |
8d9a4d83 | 736 | |
f91d003a RL |
737 | ... it's also possible to just give the key ID in URI form to B<-key>, |
738 | like this: | |
8d9a4d83 | 739 | |
f91d003a | 740 | -key org.openssl.engine:{engineid}:{keyid} |
8d9a4d83 | 741 | |
f91d003a RL |
742 | This applies to all options specifying keys: B<-key>, B<-newkey>, and |
743 | B<-tls_key>. | |
0f221d9c | 744 | {- output_on() if $disabled{"deprecated-3.0"}; "" -} |
8d9a4d83 | 745 | |
d99c8667 | 746 | =head2 TLS connection options |
8d9a4d83 DDO |
747 | |
748 | =over 4 | |
749 | ||
750 | =item B<-tls_used> | |
751 | ||
752 | Enable using TLS (even when other TLS_related options are not set) | |
753 | when connecting to CMP server. | |
754 | ||
3d46c81a | 755 | =item B<-tls_cert> I<filename>|I<uri>] |
8d9a4d83 DDO |
756 | |
757 | Client's TLS certificate. | |
3d46c81a | 758 | If the source includes further certs they are used (along with B<-untrusted> |
8b22c283 | 759 | certs) for constructing the client cert chain provided to the TLS server. |
8d9a4d83 | 760 | |
f91d003a | 761 | =item B<-tls_key> I<filename>|I<uri> |
8d9a4d83 DDO |
762 | |
763 | Private key for the client's TLS certificate. | |
764 | ||
765 | =item B<-tls_keypass> I<arg> | |
766 | ||
767 | Pass phrase source for client's private TLS key B<tls_key>. | |
768 | Also used for B<-tls_cert> in case it is an encrypted PKCS#12 file. | |
769 | If not given here, the password will be prompted for if needed. | |
770 | ||
fee0af08 RL |
771 | For more information about the format of B<arg> see |
772 | L<openssl-passphrase-options(1)>. | |
8d9a4d83 | 773 | |
3d46c81a | 774 | =item B<-tls_extra> I<filenames>|I<uris> |
8d9a4d83 DDO |
775 | |
776 | Extra certificates to provide to TLS server during TLS handshake | |
777 | ||
3d46c81a | 778 | =item B<-tls_trusted> I<filenames>|I<uris> |
8d9a4d83 DDO |
779 | |
780 | Trusted certificate(s) to use for verifying the TLS server certificate. | |
781 | This implies hostname validation. | |
782 | ||
3d46c81a | 783 | Multiple sources may be given, separated by commas and/or whitespace |
8d9a4d83 DDO |
784 | (where in the latter case the whole argument must be enclosed in "..."). |
785 | Each source may contain multiple certificates. | |
786 | ||
acb934ff DDO |
787 | The certificate verification options |
788 | B<-verify_hostname>, B<-verify_ip>, and B<-verify_email> | |
789 | have no effect on the certificate verification enabled via this option. | |
790 | ||
8d9a4d83 DDO |
791 | =item B<-tls_host> I<name> |
792 | ||
793 | Address to be checked during hostname validation. | |
794 | This may be a DNS name or an IP address. | |
795 | If not given it defaults to the B<-server> address. | |
796 | ||
797 | =back | |
798 | ||
8d9a4d83 DDO |
799 | =head2 Client-side debugging options |
800 | ||
801 | =over 4 | |
802 | ||
803 | =item B<-batch> | |
804 | ||
805 | Do not interactively prompt for input, for instance when a password is needed. | |
806 | This can be useful for batch processing and testing. | |
807 | ||
808 | =item B<-repeat> I<number> | |
809 | ||
810 | Invoke the command the given number of times with the same parameters. | |
811 | Default is one invocation. | |
812 | ||
813 | =item B<-reqin> I<filenames> | |
814 | ||
815 | Take sequence of CMP requests from file(s). | |
b434b2c0 | 816 | |
8d9a4d83 DDO |
817 | Multiple filenames may be given, separated by commas and/or whitespace |
818 | (where in the latter case the whole argument must be enclosed in "..."). | |
819 | As many files are read as needed for a complete transaction. | |
820 | ||
143be474 DDO |
821 | =item B<-reqin_new_tid> |
822 | ||
823 | Use a fresh transactionID for CMP request messages read using B<-reqin>, | |
824 | which requires re-protecting them as far as they were protected before. | |
825 | This may be needed in case the sequence of requests is reused | |
826 | and the CMP server complains that the transaction ID has already been used. | |
827 | ||
8d9a4d83 DDO |
828 | =item B<-reqout> I<filenames> |
829 | ||
830 | Save sequence of CMP requests to file(s). | |
b434b2c0 | 831 | |
8d9a4d83 DDO |
832 | Multiple filenames may be given, separated by commas and/or whitespace. |
833 | As many files are written as needed to store the complete transaction. | |
834 | ||
835 | =item B<-rspin> I<filenames> | |
836 | ||
837 | Process sequence of CMP responses provided in file(s), skipping server. | |
b434b2c0 | 838 | |
8d9a4d83 DDO |
839 | Multiple filenames may be given, separated by commas and/or whitespace. |
840 | As many files are read as needed for the complete transaction. | |
841 | ||
842 | =item B<-rspout> I<filenames> | |
843 | ||
844 | Save sequence of CMP responses to file(s). | |
b434b2c0 | 845 | |
8d9a4d83 DDO |
846 | Multiple filenames may be given, separated by commas and/or whitespace. |
847 | As many files are written as needed to store the complete transaction. | |
848 | ||
849 | =item B<-use_mock_srv> | |
850 | ||
851 | Use the internal mock server for testing the client. | |
852 | This works at API level, bypassing HTTP transport. | |
853 | ||
854 | =back | |
855 | ||
d99c8667 | 856 | =head2 Mock server options |
8d9a4d83 DDO |
857 | |
858 | =over 4 | |
859 | ||
860 | =item B<-port> I<number> | |
861 | ||
862 | Act as CMP HTTP server mock-up listening on the given port. | |
863 | ||
864 | =item B<-max_msgs> I<number> | |
865 | ||
866 | Maximum number of CMP (request) messages the CMP HTTP server mock-up | |
490c8711 | 867 | should handle, which must be nonnegative. |
8d9a4d83 DDO |
868 | The default value is 0, which means that no limit is imposed. |
869 | In any case the server terminates on internal errors, but not when it | |
870 | detects a CMP-level error that it can successfully answer with an error message. | |
871 | ||
872 | =item B<-srv_ref> I<value> | |
873 | ||
874 | Reference value to use as senderKID of server in case no B<-srv_cert> is given. | |
875 | ||
876 | =item B<-srv_secret> I<arg> | |
877 | ||
878 | Password source for server authentication with a pre-shared key (secret). | |
879 | ||
3d46c81a | 880 | =item B<-srv_cert> I<filename>|I<uri>] |
8d9a4d83 DDO |
881 | |
882 | Certificate of the server. | |
883 | ||
3d46c81a | 884 | =item B<-srv_key> I<filename>|I<uri>] |
8d9a4d83 DDO |
885 | |
886 | Private key used by the server for signing messages. | |
887 | ||
888 | =item B<-srv_keypass> I<arg> | |
889 | ||
890 | Server private key (and cert) file pass phrase source. | |
891 | ||
3d46c81a | 892 | =item B<-srv_trusted> I<filenames>|I<uris> |
8d9a4d83 DDO |
893 | |
894 | Trusted certificates for client authentication. | |
895 | ||
acb934ff DDO |
896 | The certificate verification options |
897 | B<-verify_hostname>, B<-verify_ip>, and B<-verify_email> | |
898 | have no effect on the certificate verification enabled via this option. | |
899 | ||
3d46c81a | 900 | =item B<-srv_untrusted> I<filenames>|I<uris> |
8d9a4d83 | 901 | |
6b326fc3 | 902 | Intermediate CA certs that may be useful when verifying client certificates. |
8d9a4d83 | 903 | |
3d46c81a | 904 | =item B<-rsp_cert> I<filename>|I<uri>] |
8d9a4d83 DDO |
905 | |
906 | Certificate to be returned as mock enrollment result. | |
907 | ||
3d46c81a | 908 | =item B<-rsp_extracerts> I<filenames>|I<uris> |
8d9a4d83 DDO |
909 | |
910 | Extra certificates to be included in mock certification responses. | |
911 | ||
3d46c81a | 912 | =item B<-rsp_capubs> I<filenames>|I<uris> |
8d9a4d83 DDO |
913 | |
914 | CA certificates to be included in mock Initialization Response (IP) message. | |
915 | ||
916 | =item B<-poll_count> I<number> | |
917 | ||
918 | Number of times the client must poll before receiving a certificate. | |
919 | ||
920 | =item B<-check_after> I<number> | |
921 | ||
922 | The checkAfter value (number of seconds to wait) to include in poll response. | |
923 | ||
8d9a4d83 DDO |
924 | =item B<-grant_implicitconf> |
925 | ||
926 | Grant implicit confirmation of newly enrolled certificate. | |
927 | ||
928 | =item B<-pkistatus> I<number> | |
929 | ||
930 | PKIStatus to be included in server response. | |
931 | Valid range is 0 (accepted) .. 6 (keyUpdateWarning). | |
932 | ||
933 | =item B<-failure> I<number> | |
934 | ||
935 | A single failure info bit number to be included in server response. | |
936 | Valid range is 0 (badAlg) .. 26 (duplicateCertReq). | |
937 | ||
938 | =item B<-failurebits> I<number> | |
939 | Number representing failure bits to be included in server response. | |
940 | Valid range is 0 .. 2^27 - 1. | |
941 | ||
942 | =item B<-statusstring> I<arg> | |
943 | ||
944 | Text to be included as status string in server response. | |
945 | ||
946 | =item B<-send_error> | |
947 | ||
948 | Force server to reply with error message. | |
949 | ||
950 | =item B<-send_unprotected> | |
951 | ||
952 | Send response messages without CMP-level protection. | |
953 | ||
954 | =item B<-send_unprot_err> | |
955 | ||
956 | In case of negative responses, server shall send unprotected error messages, | |
957 | certificate responses (IP/CP/KUP), and revocation responses (RP). | |
958 | WARNING: This setting leads to behavior violating RFC 4210. | |
959 | ||
960 | =item B<-accept_unprotected> | |
961 | ||
962 | Accept missing or invalid protection of requests. | |
963 | ||
964 | =item B<-accept_unprot_err> | |
965 | ||
966 | Accept unprotected error messages from client. | |
967 | ||
968 | =item B<-accept_raverified> | |
969 | ||
970 | Accept RAVERIFED as proof-of-possession (POPO). | |
971 | ||
972 | =back | |
973 | ||
d99c8667 DDO |
974 | =head2 Certificate verification options, for both CMP and TLS |
975 | ||
976 | =over 4 | |
977 | ||
acb934ff DDO |
978 | {- $OpenSSL::safe::opt_v_item -} |
979 | ||
980 | The certificate verification options | |
981 | B<-verify_hostname>, B<-verify_ip>, and B<-verify_email> | |
982 | only affect the certificate verification enabled via the B<-out_trusted> option. | |
d99c8667 DDO |
983 | |
984 | =back | |
8d9a4d83 DDO |
985 | |
986 | =head1 NOTES | |
987 | ||
988 | When setting up CMP configurations and experimenting with enrollment options | |
989 | typically various errors occur until the configuration is correct and complete. | |
990 | When the CMP server reports an error the client will by default | |
991 | check the protection of the CMP response message. | |
992 | Yet some CMP services tend not to protect negative responses. | |
993 | In this case the client will reject them, and thus their contents are not shown | |
994 | although they usually contain hints that would be helpful for diagnostics. | |
995 | For assisting in such cases the CMP client offers a workaround via the | |
996 | B<-unprotected_errors> option, which allows accepting such negative messages. | |
997 | ||
8d9a4d83 DDO |
998 | =head1 EXAMPLES |
999 | ||
1000 | =head2 Simple examples using the default OpenSSL configuration file | |
1001 | ||
1002 | This CMP client implementation comes with demonstrative CMP sections | |
1003 | in the example configuration file F<openssl/apps/openssl.cnf>, | |
1004 | which can be used to interact conveniently with the Insta Demo CA. | |
1005 | ||
1006 | In order to enroll an initial certificate from that CA it is sufficient | |
1007 | to issue the following shell commands. | |
1008 | ||
1009 | cd /path/to/openssl | |
1010 | export OPENSSL_CONF=openssl.cnf | |
6600baa9 | 1011 | |
ebc1e8fc | 1012 | =begin comment |
6600baa9 | 1013 | |
4d2b2889 | 1014 | wget 'http://pki.certificate.fi:8081/install-ca-cert.html/ca-certificate.crt\ |
8d9a4d83 | 1015 | ?ca-id=632&download-certificate=1' -O insta.ca.crt |
6600baa9 | 1016 | |
ebc1e8fc | 1017 | =end comment |
6600baa9 | 1018 | |
8d9a4d83 DDO |
1019 | openssl genrsa -out insta.priv.pem |
1020 | openssl cmp -section insta | |
1021 | ||
1022 | This should produce the file F<insta.cert.pem> containing a new certificate | |
1023 | for the private key held in F<insta.priv.pem>. | |
1024 | It can be viewed using, e.g., | |
1025 | ||
1026 | openssl x509 -noout -text -in insta.cert.pem | |
1027 | ||
1028 | In case the network setup requires using an HTTP proxy it may be given as usual | |
1029 | via the environment variable B<http_proxy> or via the B<proxy> option or | |
1030 | the CMP command-line argument B<-proxy>, for example | |
1031 | ||
1032 | -proxy http://192.168.1.1:8080 | |
1033 | ||
1034 | In the Insta Demo CA scenario both clients and the server may use the pre-shared | |
8b22c283 | 1035 | secret I<insta> and the reference value I<3078> to authenticate to each other. |
8d9a4d83 DDO |
1036 | |
1037 | Alternatively, CMP messages may be protected in signature-based manner, | |
1038 | where the trust anchor in this case is F<insta.ca.crt> | |
1039 | and the client may use any certificate already obtained from that CA, | |
1040 | as specified in the B<[signature]> section of the example configuration. | |
1041 | This can be used in combination with the B<[insta]> section simply by | |
1042 | ||
1043 | openssl cmp -section insta,signature | |
1044 | ||
1045 | By default the CMP IR message type is used, yet CR works equally here. | |
1046 | This may be specified directly at the command line: | |
1047 | ||
1048 | openssl cmp -section insta -cmd cr | |
1049 | ||
1050 | or by referencing in addition the B<[cr]> section of the example configuration: | |
1051 | ||
1052 | openssl cmp -section insta,cr | |
1053 | ||
1054 | In order to update the enrolled certificate one may call | |
1055 | ||
1056 | openssl cmp -section insta,kur | |
1057 | ||
1058 | using with PBM-based protection or | |
1059 | ||
1060 | openssl cmp -section insta,kur,signature | |
1061 | ||
1062 | using signature-based protection. | |
1063 | ||
1064 | In a similar way any previously enrolled certificate may be revoked by | |
1065 | ||
1066 | openssl cmp -section insta,rr -trusted insta.ca.crt | |
1067 | ||
1068 | or | |
1069 | ||
1070 | openssl cmp -section insta,rr,signature | |
1071 | ||
1072 | Many more options can be used in the configuration file | |
1073 | and/or on the command line. | |
ebc1e8fc DDO |
1074 | For instance, the B<-reqexts> CLI option may refer to a section in the |
1075 | configuration file defining X.509 extensions to use in certificate requests, | |
1076 | such as B<v3_req> in F<openssl/apps/openssl.cnf>: | |
8d9a4d83 | 1077 | |
ebc1e8fc | 1078 | openssl cmp -section insta,cr -reqexts v3_req |
8d9a4d83 DDO |
1079 | |
1080 | =head2 Certificate enrollment | |
1081 | ||
1082 | The following examples at first do not make use of a configuration file. | |
1083 | They assume that a CMP server can be contacted on the local TCP port 80 | |
8b22c283 | 1084 | and accepts requests under the alias I</pkix/>. |
8d9a4d83 DDO |
1085 | |
1086 | For enrolling its very first certificate the client generates a first client key | |
1087 | and sends an initial request message to the local CMP server | |
1088 | using a pre-shared secret key for mutual authentication. | |
1089 | In this example the client does not have the CA certificate yet, | |
1090 | so we specify the name of the CA with the B<-recipient> option | |
1091 | and save any CA certificates that we may receive in the C<capubs.pem> file. | |
1092 | ||
1093 | In below command line usage examples the C<\> at line ends is just used | |
1094 | for formatting; each of the command invocations should be on a single line. | |
1095 | ||
1096 | openssl genrsa -out cl_key.pem | |
d99c8667 | 1097 | openssl cmp -cmd ir -server 127.0.0.1:80/pkix/ \ |
8d9a4d83 DDO |
1098 | -ref 1234 -secret pass:1234-5678-1234-5678 \ |
1099 | -recipient "/CN=CMPserver" \ | |
1100 | -newkey cl_key.pem -subject "/CN=MyName" \ | |
1101 | -cacertsout capubs.pem -certout cl_cert.pem | |
1102 | ||
8d9a4d83 DDO |
1103 | =head2 Certificate update |
1104 | ||
1105 | Then, when the client certificate and its related key pair needs to be updated, | |
1106 | the client can send a key update request taking the certs in C<capubs.pem> | |
1107 | as trusted for authenticating the server and using the previous cert and key | |
1108 | for its own authentication. | |
1109 | Then it can start using the new cert and key. | |
1110 | ||
1111 | openssl genrsa -out cl_key_new.pem | |
d99c8667 | 1112 | openssl cmp -cmd kur -server 127.0.0.1:80/pkix/ \ |
8d9a4d83 DDO |
1113 | -trusted capubs.pem \ |
1114 | -cert cl_cert.pem -key cl_key.pem \ | |
1115 | -newkey cl_key_new.pem -certout cl_cert.pem | |
1116 | cp cl_key_new.pem cl_key.pem | |
1117 | ||
1118 | This command sequence can be repated as often as needed. | |
1119 | ||
8d9a4d83 DDO |
1120 | =head2 Requesting information from CMP server |
1121 | ||
1122 | Requesting "all relevant information" with an empty General Message. | |
1123 | This prints information about all received ITAV B<infoType>s to stdout. | |
1124 | ||
d99c8667 | 1125 | openssl cmp -cmd genm -server 127.0.0.1/pkix/ \ |
8d9a4d83 DDO |
1126 | -ref 1234 -secret pass:1234-5678-1234-5678 \ |
1127 | -recipient "/CN=CMPserver" | |
1128 | ||
8d9a4d83 DDO |
1129 | =head2 Using a custom configuration file |
1130 | ||
1131 | For CMP client invocations, in particular for certificate enrollment, | |
1132 | usually many parameters need to be set, which is tedious and error-prone to do | |
1133 | on the command line. | |
8c1cbc72 | 1134 | Therefore, the client offers the possibility to read |
8d9a4d83 DDO |
1135 | options from sections of the OpenSSL config file, usually called B<openssl.cnf>. |
1136 | The values found there can still be extended and even overridden by any | |
1137 | subsequently loaded sections and on the command line. | |
1138 | ||
1139 | After including in the configuration file the following sections: | |
1140 | ||
1141 | [cmp] | |
1142 | server = 127.0.0.1 | |
1143 | path = pkix/ | |
1144 | trusted = capubs.pem | |
1145 | cert = cl_cert.pem | |
1146 | key = cl_key.pem | |
1147 | newkey = cl_key.pem | |
1148 | certout = cl_cert.pem | |
1149 | ||
1150 | [cmp-init] | |
1151 | recipient = "/CN=CMPserver" | |
1152 | trusted = | |
1153 | cert = | |
1154 | key = | |
1155 | ref = 1234 | |
1156 | secret = pass:1234-5678-1234-567 | |
1157 | subject = "/CN=MyName" | |
1158 | cacertsout = capubs.pem | |
1159 | ||
1160 | the above enrollment invocations reduce to | |
1161 | ||
1162 | openssl cmp -section cmp,cmp-init | |
1163 | openssl cmp -cmd kur -newkey cl_key_new.pem | |
1164 | ||
1165 | and the above genm call reduces to | |
1166 | ||
1167 | openssl cmp -section cmp,cmp-init -cmd genm | |
1168 | ||
1169 | =head1 SEE ALSO | |
1170 | ||
1171 | L<openssl-genrsa(1)>, L<openssl-ecparam(1)>, L<openssl-list(1)>, | |
1172 | L<openssl-req(1)>, L<openssl-x509(1)>, L<x509v3_config(5)> | |
1173 | ||
f91d003a RL |
1174 | =head1 HISTORY |
1175 | ||
1176 | The B<cmp> application was added in OpenSSL 3.0. | |
1177 | ||
1178 | The B<-engine option> was deprecated in OpenSSL 3.0. | |
1179 | ||
8d9a4d83 DDO |
1180 | =head1 COPYRIGHT |
1181 | ||
4333b89f | 1182 | Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved. |
8d9a4d83 DDO |
1183 | |
1184 | Licensed under the OpenSSL license (the "License"). You may not use | |
1185 | this file except in compliance with the License. You can obtain a copy | |
1186 | in the file LICENSE in the source distribution or at | |
1187 | L<https://www.openssl.org/source/license.html>. | |
1188 | ||
1189 | =cut |