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