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