2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
6 openssl-cmp - client for the Certificate Management Protocol (CMP, RFC 4210)
12 [B<-config> I<filename>]
13 [B<-section> I<names>]
15 [B<-server> I<[http[s]://]address[:port][/path]>]
16 [B<-proxy> I<[http[s]://]address[:port][/path]>]
17 [B<-no_proxy> I<addresses>]
18 [B<-path> I<remote_path>]
19 [B<-msg_timeout> I<seconds>]
20 [B<-total_timeout> I<seconds>]
22 [B<-trusted> I<filenames>]
23 [B<-untrusted> I<sources>]
24 [B<-srvcert> I<filename>]
25 [B<-recipient> I<name>]
26 [B<-expect_sender> I<name>]
28 [B<-unprotected_errors>]
29 [B<-extracertsout> I<filename>]
30 [B<-cacertsout> I<filename>]
34 [B<-cert> I<filename>]
35 [B<-own_trusted> I<filenames>]
40 [B<-extracerts> I<sources>]
41 [B<-unprotected_requests>]
43 [B<-cmd> I<ir|cr|kur|p10cr|rr|genm>]
44 [B<-infotype> I<name>]
45 [B<-geninfo> I<OID:int:N>]
47 [B<-newkey> I<filename>]
48 [B<-newkeypass> I<arg>]
55 [B<-policies> I<name>]
56 [B<-policy_oids> I<names>]
57 [B<-policy_oids_critical>]
60 [B<-out_trusted> I<filenames>]
61 [B<-verify_hostname> I<cn>]
63 [B<-verify_email> I<email>]
64 [B<-implicit_confirm>]
66 [B<-certout> I<filename>]
67 [B<-chainout> I<filename>]
69 [B<-oldcert> I<filename>]
70 [B<-revreason> I<number>]
72 [B<-certform> I<PEM|DER>]
73 [B<-keyform> I<PEM|DER|P12|ENGINE>]
74 [B<-otherpass> I<arg>]
75 {- $OpenSSL::safe::opt_engine_synopsis -}
76 {- $OpenSSL::safe::opt_provider_synopsis -}
79 [B<-tls_cert> I<filename>]
80 [B<-tls_key> I<filename>]
81 [B<-tls_keypass> I<arg>]
82 [B<-tls_extra> I<filenames>]
83 [B<-tls_trusted> I<filenames>]
84 [B<-tls_host> I<name>]
86 [B<-verbosity> I<level>]
88 [B<-repeat> I<number>]
89 [B<-reqin>] I<filenames>
91 [B<-reqout>] I<filenames>
92 [B<-rspin>] I<filenames>
93 [B<-rspout>] I<filenames>
97 [B<-purpose> I<purpose>]
98 [B<-verify_name> I<name>]
99 [B<-verify_depth> I<num>]
100 [B<-auth_level> I<level>]
101 [B<-attime> I<timestamp>]
102 [B<-ignore_critical>]
105 [B<-explicit_policy>]
116 [B<-suiteB_128_only>]
122 [B<-allow_proxy_certs>]
125 [B<-max_msgs> I<number>]
126 [B<-srv_ref> I<value>]
127 [B<-srv_secret> I<arg>]
128 [B<-srv_cert> I<filename>]
129 [B<-srv_key> I<filename>]
130 [B<-srv_keypass> I<arg>]
131 [B<-srv_trusted> I<filenames>]
132 [B<-srv_untrusted> I<filenames>]
133 [B<-rsp_cert> I<filename>]
134 [B<-rsp_extracerts> I<filenames>]
135 [B<-rsp_capubs> I<filenames>]
136 [B<-poll_count> I<number>]
137 [B<-check_after> I<number>]
138 [B<-grant_implicitconf>]
139 [B<-pkistatus> I<number>]
140 [B<-failure> I<number>]
141 [B<-failurebits> I<number>]
142 [B<-statusstring> I<arg>]
144 [B<-send_unprotected>]
145 [B<-send_unprot_err>]
146 [B<-accept_unprotected>]
147 [B<-accept_unprot_err>]
148 [B<-accept_raverified>]
152 The B<cmp> command is a client implementation for the Certificate
153 Management Protocol (CMP) as defined in RFC4210.
154 It can be used to request certificates from a CA server,
155 update their certificates,
156 request certificates to be revoked, and perform other types of CMP requests.
164 Display a summary of all options
166 =item B<-config> I<filename>
168 Configuration file to use.
169 An empty string C<""> means none.
170 Default filename is from the environment variable C<OPENSSL_CONF>.
172 =item B<-section> I<names>
174 Section(s) to use within config file defining CMP options.
175 An empty string C<""> means no specific section.
178 Multiple section names may be given, separated by commas and/or whitespace
179 (where in the latter case the whole argument must be enclosed in "...").
180 Contents of sections named later may override contents of sections named before.
181 In any case, as usual, the C<[default]> section and finally the unnamed
182 section (as far as present) can provide per-option fallback values.
187 =head2 Generic message options
191 =item B<-cmd> I<ir|cr|kur|p10cr|rr|genm>
193 CMP command to execute.
194 Currently implemented commands are:
198 =item ir E<nbsp> - Initialization Request
200 =item cr E<nbsp> - Certificate Request
202 =item p10cr - PKCS#10 Certification Request (for legacy support)
204 =item kur E<nbsp>E<nbsp>- Key Update Request
206 =item rr E<nbsp> - Revocation Request
208 =item genm - General Message
212 B<ir> requests initialization of an End Entity into a PKI hierarchy
213 by issuing a first certificate.
215 B<cr> requests issuing an additional certificate for an End Entity already
216 initialized to the PKI hierarchy.
218 B<p10cr> requests issuing an additional certificate similarly to B<cr>
219 but uses PKCS#10 CSR format.
221 B<kur> requests a (key) update for an existing, given certificate.
223 B<rr> requests revocation of an existing, given certificate.
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.
230 =item B<-infotype> I<name>
232 Set InfoType name to use for requesting specific info in B<genm>,
233 e.g., C<signKeyPairTypes>.
235 =item B<-geninfo> I<OID:int:N>
237 generalInfo integer values to place in request PKIHeader with given OID,
238 e.g., C<1.2.3:int:987>.
243 =head2 Certificate request options
247 =item B<-newkey> I<filename>
249 The file containing the private or public key for the certificate requested
250 in Initialization Request (IR), Certification Request(CR), or
251 Key Update Request (KUR).
252 Default is the public key in the PKCS#10 CSR given with the B<-csr> option,
253 if any, or else the current client key, if given.
255 =item B<-newkeypass> I<arg>
257 Pass phrase source for the key given with the B<-newkey> option.
258 If not given here, the password will be prompted for if needed.
260 For more information about the format of B<arg> see the
261 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
263 =item B<-subject> I<name>
265 X509 Distinguished Name (DN) of subject to use in the requested certificate
267 For KUR, it defaults to the subject DN of the reference certificate
269 This default is used for IR and CR only if no SANs are set.
271 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
272 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
274 The subject DN is also used as fallback sender of outgoing CMP messages
275 if no B<-cert> and no B<-oldcert> are given.
277 =item B<-issuer> I<name>
279 X509 issuer Distinguished Name (DN) of the CA server
280 to place in the requested certificate template in IR/CR/KUR.
282 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
283 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
285 If neither B<-srvcert> nor B<-recipient> is available,
286 the name given in this option is also set as the recipient of the CMP message.
288 =item B<-days> I<number>
290 Number of days the new certificate is requested to be valid for, counting from
291 the current time of the host.
292 Also triggers the explicit request that the
293 validity period starts from the current time (as seen by the host).
295 =item B<-reqexts> I<name>
297 Name of section in OpenSSL config file defining certificate request extensions.
299 =item B<-sans> I<spec>
301 One or more IP addresses, DNS names, or URIs separated by commas or whitespace
302 (where in the latter case the whole argument must be enclosed in "...")
303 to add as Subject Alternative Name(s) (SAN) certificate request extension.
304 If the special element "critical" is given the SANs are flagged as critical.
305 Cannot be used if any Subject Alternative Name extension is set via B<-reqexts>.
307 =item B<-san_nodefault>
309 When Subject Alternative Names are not given via B<-sans>
310 nor defined via B<-reqexts>,
311 they are copied by default from the reference certificate (see B<-oldcert>).
312 This can be disabled by giving the B<-san_nodefault> option.
314 =item B<-policies> I<name>
316 Name of section in OpenSSL config file defining policies to be set
317 as certificate request extension.
318 This option cannot be used together with B<-policy_oids>.
320 =item B<-policy_oids> I<names>
322 One or more OID(s), separated by commas and/or whitespace
323 (where in the latter case the whole argument must be enclosed in "...")
324 to add as certificate policies request extension.
325 This option cannot be used together with B<-policies>.
327 =item B<-policy_oids_critical>
329 Flag the policies given with B<-policy_oids> as critical.
331 =item B<-popo> I<number>
333 Proof-of-Possession (POPO) method to use for IR/CR/KUR; values: C<-1>..<2> where
334 C<-1> = NONE, C<0> = RAVERIFIED, C<1> = SIGNATURE (default), C<2> = KEYENC.
336 Note that a signature-based POPO can only be produced if a private key
337 is provided via the B<-newkey> or B<-key> options.
339 =item B<-csr> I<filename>
341 PKCS#10 CSR in PEM or DER format to use in legacy P10CR messages.
343 =item B<-out_trusted> I<filenames>
345 Trusted certificate(s) to use for verifying the newly enrolled certificate.
347 Multiple filenames may be given, separated by commas and/or whitespace
348 (where in the latter case the whole argument must be enclosed in "...").
349 Each source may contain multiple certificates.
351 =item B<-verify_hostname> I<name>
353 When verification of the newly enrolled certificate is enabled (with the
354 B<-out_trusted> option), check if any DNS Subject Alternative Name (or if no
355 DNS SAN is included, the Common Name in the subject) equals the given B<name>.
357 =item B<-verify_ip> I<ip>
359 When verification of the newly enrolled certificate is enabled (with the
360 B<-out_trusted> option), check if there is
361 an IP address Subject Alternative Name matching the given IP address.
363 =item B<-verify_email> I<email>
365 When verification of the newly enrolled certificate is enabled (with the
366 B<-out_trusted> option), check if there is
367 an email address Subject Alternative Name matching the given email address.
369 =item B<-implicit_confirm>
371 Request implicit confirmation of newly enrolled certificates.
373 =item B<-disable_confirm>
375 Do not send certificate confirmation message for newly enrolled certificate
376 without requesting implicit confirmation
377 to cope with broken servers not supporting implicit confirmation correctly.
378 B<WARNING:> This leads to behavior violating RFC 4210.
380 =item B<-certout> I<filename>
382 The file where the newly enrolled certificate should be saved.
384 =item B<-chainout> I<filename>
386 The file where the chain of the newly enrolled certificate should be saved.
391 =head2 Certificate revocation options
395 =item B<-oldcert> I<filename>
397 The certificate to be updated (i.e., renewed or re-keyed) in Key Update Request
398 (KUR) messages or to be revoked in Revocation Request (RR) messages.
399 It must be given for RR, while for KUR it defaults to B<-cert>.
401 The reference certificate determined in this way, if any, is also used for
402 deriving default subject DN and Subject Alternative Names for IR, CR, and KUR.
403 Its subject is used as sender of outgoing messages if B<-cert> is not given.
404 Its issuer is used as default recipient in CMP message headers
405 if neither B<-recipient>, B<-srvcert>, nor B<-issuer> is given.
407 =item B<-revreason> I<number>
409 Set CRLReason to be included in revocation request (RR); values: C<0>..C<10>
410 or C<-1> for none (which is the default).
412 Reason numbers defined in RFC 5280 are:
414 CRLReason ::= ENUMERATED {
418 affiliationChanged (3),
420 cessationOfOperation (5),
422 -- value 7 is not used
424 privilegeWithdrawn (9),
431 =head2 Message transfer options
435 =item B<-server> I<[http[s]://]address[:port][/path]>
437 The IP address or DNS hostname and optionally port (defaulting to 80 or 443)
438 of the CMP server to connect to using HTTP(S) transport.
439 The optional I<http://> or I<https://> prefix is ignored.
440 If a path is included it provides the default value for the B<-path> option.
442 =item B<-proxy> I<[http[s]://]address[:port][/path]>
444 The HTTP(S) proxy server to use for reaching the CMP server unless B<no_proxy>
446 The optional I<http://> or I<https://> prefix and any trailing path are ignored.
447 Defaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY>
448 in case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>.
450 =item B<-no_proxy> I<addresses>
451 List of IP addresses and/or DNS names of servers
452 not to use an HTTP(S) proxy for, separated by commas and/or whitespace
453 (where in the latter case the whole argument must be enclosed in "...").
454 Default is from the environment variable C<no_proxy> if set, else C<NO_PROXY>.
456 =item B<-path> I<remote_path>
458 HTTP path at the CMP server (aka CMP alias) to use for POST requests.
459 Defaults to any path given with B<-server>, else C<"/">.
461 =item B<-msg_timeout> I<seconds>
463 Number of seconds (or 0 for infinite) a CMP request-response message round trip
464 is allowed to take before a timeout error is returned.
467 =item B<-total_timeout> I<seconds>
469 Maximum number seconds an overall enrollment transaction may take,
470 including attempts polling for certificates on C<waiting> PKIStatus.
471 Default is 0 (infinite).
476 =head2 Server authentication options
480 =item B<-trusted> I<filenames>
482 When verifying signature-based protection of CMP response messages,
483 these are the CA certificate(s) to trust while checking certificate chains
484 during CMP server authentication.
485 This option gives more flexibility than the B<-srvcert> option because the
486 protection certificate is not pinned but may be any certificate
487 for which a chain to one of the given trusted certificates can be constructed.
489 If no B<-trusted>, B<-srvcert>, and B<-secret> option is given
490 then protected response messages from the server are not authenticated.
492 Multiple filenames may be given, separated by commas and/or whitespace
493 (where in the latter case the whole argument must be enclosed in "...").
494 Each source may contain multiple certificates.
496 =item B<-untrusted> I<sources>
498 Non-trusted intermediate CA certificate(s) that may be useful for cert path
499 construction for the CMP client certificate (to include in the extraCerts field
500 of outgoing messages), for the TLS client certificate (if TLS is enabled),
501 when verifying the CMP server certificate (checking signature-based
502 CMP message protection), and when verifying newly enrolled certificates.
504 Multiple filenames may be given, separated by commas and/or whitespace.
505 Each file may contain multiple certificates.
507 =item B<-srvcert> I<filename>
509 The specific CMP server certificate to expect and directly trust (even if it is
510 expired) when verifying signature-based protection of CMP response messages.
511 May be set alternatively to the B<-trusted> option to pin the accepted server.
513 If set, the subject of the certificate is also used
514 as default value for the recipient of CMP requests
515 and as default value for the expected sender of incoming CMP messages.
517 =item B<-recipient> I<name>
519 Distinguished Name (DN) to use in the recipient field of CMP request messages,
520 i.e., the CMP server (usually the addressed CA).
522 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
523 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
524 The empty name (NULL-DN) can be given explicitly as a single slash: 'I</>'.
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.
534 =item B<-expect_sender> I<name>
536 Distinguished Name (DN) expected in the sender field of incoming CMP messages.
537 Defaults to the subject DN of the pinned B<-srvcert>, if any.
539 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
540 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
542 This can be used to make sure that only a particular entity is accepted as
543 CMP message signer, and attackers are not able to use arbitrary certificates
544 of a trusted PKI hierarchy to fraudulently pose as a CMP server.
545 Note that this option gives slightly more freedom than setting the B<-srvcert>,
546 which pins the server to the holder of a particular certificate, while the
547 expected sender name will continue to match after updates of the server cert.
549 =item B<-ignore_keyusage>
551 Ignore key usage restrictions in CMP signer certificates when verifying
552 signature-based protection of incoming CMP messages,
553 else C<digitalSignature> must be allowed for signer certificate.
555 =item B<-unprotected_errors>
557 Accept missing or invalid protection of negative responses from the server.
558 This applies to the following message types and contents:
562 =item * error messages
564 =item * negative certificate responses (IP/CP/KUP)
566 =item * negative revocation responses (RP)
568 =item * negative PKIConf messages
572 B<WARNING:> This setting leads to unspecified behavior and it is meant
573 exclusively to allow interoperability with server implementations violating
578 =item * section 5.1.3.1 allows exceptions from protecting only for special
580 "There MAY be cases in which the PKIProtection BIT STRING is deliberately not
581 used to protect a message [...] because other protection, external to PKIX, will
584 =item * section 5.3.21 is clear on ErrMsgContent: "The CA MUST always sign it
585 with a signature key."
587 =item * appendix D.4 shows PKIConf message having protection
591 =item B<-extracertsout> I<filename>
593 The file where to save any extra certificates received in the extraCerts field
594 of response messages.
596 =item B<-cacertsout> I<filename>
598 The file where to save any CA certificates received in the caPubs field of
599 Initialization Response (IP) messages.
604 =head2 Client authentication options
608 =item B<-ref> I<value>
610 Reference number/string/value to use as fallback senderKID; this is required
611 if no sender name can be determined from the B<-cert> or <-subject> options and
612 is typically used when authenticating with pre-shared key (password-based MAC).
614 =item B<-secret> I<arg>
616 Source of secret value to use for creating PBM-based protection of outgoing
617 messages and for verifying any PBM-based protection of incoming messages.
618 PBM stands for Password-Based Message Authentication Code.
619 This takes precedence over the B<-cert> option.
621 For more information about the format of B<arg> see the
622 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
624 =item B<-cert> I<filename>
626 The client's current CMP signer certificate.
627 Requires the corresponding key to be given with B<-key>.
628 The subject of this certificate will be used as sender of outgoing CMP messages,
629 while the subject of B<-oldcert> or B<-subjectName> may provide fallback values.
630 When using signature-based message protection, this "protection certificate"
631 will be included first in the extraCerts field of outgoing messages.
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.
636 If the file includes further certs, they are appended to the untrusted certs.
638 =item B<-own_trusted> I<filenames>
640 If this list of certificates is provided then the chain built for
641 the CMP signer certificate given with the B<-cert> option is verified
642 using the given certificates as trust anchors.
644 Multiple filenames may be given, separated by commas and/or whitespace
645 (where in the latter case the whole argument must be enclosed in "...").
646 Each source may contain multiple certificates.
648 =item B<-key> I<filename>
650 The corresponding private key file for the client's current certificate given in
652 This will be used for signature-based message protection unless
653 the B<-secret> option indicating PBM or B<-unprotected_requests> is given.
655 =item B<-keypass> I<arg>
657 Pass phrase source for the private key given with the B<-key> option.
658 Also used for B<-cert> and B<-oldcert> in case it is an encrypted PKCS#12 file.
659 If not given here, the password will be prompted for if needed.
661 For more information about the format of B<arg> see the
662 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
664 =item B<-digest> I<name>
666 Specifies name of supported digest to use in RFC 4210's MSG_SIG_ALG
667 and as the one-way function (OWF) in MSG_MAC_ALG.
668 If applicable, this is used for message protection and
669 Proof-of-Possession (POPO) signatures.
670 To see the list of supported digests, use B<openssl list -digest-commands>.
671 Defaults to C<sha256>.
673 =item B<-mac> I<name>
675 Specifies the name of the MAC algorithm in MSG_MAC_ALG.
676 To get the names of supported MAC algorithms use B<openssl list -mac-algorithms>
677 and possibly combine such a name with the name of a supported digest algorithm,
678 e.g., hmacWithSHA256.
679 Defaults to C<hmac-sha1> as per RFC 4210.
681 =item B<-extracerts> I<sources>
683 Certificates to append in the extraCerts field when sending messages.
684 They can be used as the default CMP signer certificate chain to include.
686 Multiple filenames or URLs may be given, separated by commas and/or whitespace
687 (where in the latter case the whole argument must be enclosed in "...").
688 Each source may contain multiple certificates.
690 =item B<-unprotected_requests>
692 Send messages without CMP-level protection.
697 =head2 Credentials format options
701 =item B<-certform> I<PEM|DER>
703 File format to use when saving a certificate to a file.
704 Default value is PEM.
706 =item B<-keyform> I<PEM|DER|P12|ENGINE>
708 The format of the key input.
709 The only value with effect is B<ENGINE>.
711 =item B<-otherpass> I<arg>
713 Pass phrase source for certificate given with the B<-trusted>, B<-untrusted>,
715 B<-out_trusted>, B<-extracerts>, B<-tls_extra>, or B<-tls_trusted> options.
716 If not given here, the password will be prompted for if needed.
718 For more information about the format of B<arg> see the
719 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
720 {- output_off() if $disabled{"deprecated-3.0"}; "" -}
722 =item B<-engine> I<id>
724 Specifying a crypto engine B<id> will lead to obtaining a functional
725 reference to the specified engine, initializing it if needed.
726 The engine will be used for all algorithms supported for keys
727 prefixed by C<engine:>.
728 Engines may be defined in the OpenSSL config file as usual in an engine section.
730 Options specifying keys, like B<-key>, B<-newkey>, B<-tls_key> can prefix
731 C<engine:> to engine-specific identifiers for security tokens objects held by
733 The following example utilizes the RFC 7512 PKCS #11 URI scheme
734 as supported, e.g., by libp11:
735 C<-key engine:pkcs11:object=my-private-key;type=private;pin-value=1234>
737 {- output_on() if $disabled{"deprecated-3.0"}; "" -}
738 {- $OpenSSL::safe::opt_provider_item -}
749 Enable using TLS (even when other TLS_related options are not set)
750 when connecting to CMP server.
752 =item B<-tls_cert> I<filename>
754 Client's TLS certificate.
755 If the file includes further certs they are used (along with B<-untrusted>
756 certs) for constructing the client cert chain provided to the TLS server.
758 =item B<-tls_key> I<filename>
760 Private key for the client's TLS certificate.
762 =item B<-tls_keypass> I<arg>
764 Pass phrase source for client's private TLS key B<tls_key>.
765 Also used for B<-tls_cert> in case it is an encrypted PKCS#12 file.
766 If not given here, the password will be prompted for if needed.
768 For more information about the format of B<arg> see the
769 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
771 =item B<-tls_extra> I<filenames>
773 Extra certificates to provide to TLS server during TLS handshake
775 =item B<-tls_trusted> I<filenames>
777 Trusted certificate(s) to use for verifying the TLS server certificate.
778 This implies hostname validation.
780 Multiple filenames may be given, separated by commas and/or whitespace
781 (where in the latter case the whole argument must be enclosed in "...").
782 Each source may contain multiple certificates.
784 =item B<-tls_host> I<name>
786 Address to be checked during hostname validation.
787 This may be a DNS name or an IP address.
788 If not given it defaults to the B<-server> address.
793 =head2 Client-side debugging options
797 =item B<-verbosity> I<level>
799 Level of verbosity for logging, error output, etc.
800 0 = EMERG, 1 = ALERT, 2 = CRIT, 3 = ERR, 4 = WARN, 5 = NOTE,
801 6 = INFO, 7 = DEBUG, 8 = TRACE.
802 Defaults to 6 = INFO.
806 Do not interactively prompt for input, for instance when a password is needed.
807 This can be useful for batch processing and testing.
809 =item B<-repeat> I<number>
811 Invoke the command the given number of times with the same parameters.
812 Default is one invocation.
814 =item B<-reqin> I<filenames>
816 Take sequence of CMP requests from file(s).
818 Multiple filenames may be given, separated by commas and/or whitespace
819 (where in the latter case the whole argument must be enclosed in "...").
820 As many files are read as needed for a complete transaction.
822 =item B<-reqin_new_tid>
824 Use a fresh transactionID for CMP request messages read using B<-reqin>,
825 which requires re-protecting them as far as they were protected before.
826 This may be needed in case the sequence of requests is reused
827 and the CMP server complains that the transaction ID has already been used.
829 =item B<-reqout> I<filenames>
831 Save sequence of CMP requests to file(s).
833 Multiple filenames may be given, separated by commas and/or whitespace.
834 As many files are written as needed to store the complete transaction.
836 =item B<-rspin> I<filenames>
838 Process sequence of CMP responses provided in file(s), skipping server.
840 Multiple filenames may be given, separated by commas and/or whitespace.
841 As many files are read as needed for the complete transaction.
843 =item B<-rspout> I<filenames>
845 Save sequence of CMP responses to file(s).
847 Multiple filenames may be given, separated by commas and/or whitespace.
848 As many files are written as needed to store the complete transaction.
850 =item B<-use_mock_srv>
852 Use the internal mock server for testing the client.
853 This works at API level, bypassing HTTP transport.
858 =head2 Certificate verification options, for both CMP and TLS
862 =item B<-policy>, B<-purpose>, B<-verify_name>, B<-verify_depth>,
864 B<-ignore_critical>, B<-issuer_checks>,
866 B<-explicit_policy>, B<-inhibit_any>, B<-inhibit_map>,
867 B<-x509_strict>, B<-extended_crl>, B<-use_deltas>,
868 B<-policy_print>, B<-check_ss_sig>, B<-crl_check>, B<-crl_check_all>,
870 B<-suiteB_128_only>, B<-suiteB_128>, B<-suiteB_192>,
871 B<-partial_chain>, B<-no_alt_chains>, B<-no_check_time>,
873 B<-allow_proxy_certs>
875 Set various options of certificate chain verification.
876 See L<openssl(1)/Verification Options> for details.
881 =head2 Mock server options, for testing purposes only
885 =item B<-port> I<number>
887 Act as CMP HTTP server mock-up listening on the given port.
889 =item B<-max_msgs> I<number>
891 Maximum number of CMP (request) messages the CMP HTTP server mock-up
892 should handle, which must be nonnegative.
893 The default value is 0, which means that no limit is imposed.
894 In any case the server terminates on internal errors, but not when it
895 detects a CMP-level error that it can successfully answer with an error message.
897 =item B<-srv_ref> I<value>
899 Reference value to use as senderKID of server in case no B<-srv_cert> is given.
901 =item B<-srv_secret> I<arg>
903 Password source for server authentication with a pre-shared key (secret).
905 =item B<-srv_cert> I<filename>
907 Certificate of the server.
909 =item B<-srv_key> I<filename>
911 Private key used by the server for signing messages.
913 =item B<-srv_keypass> I<arg>
915 Server private key (and cert) file pass phrase source.
917 =item B<-srv_trusted> I<filenames>
919 Trusted certificates for client authentication.
921 =item B<-srv_untrusted> I<filenames>
923 Intermediate CA certs that may be useful when verifying client certificates.
925 =item B<-rsp_cert> I<filename>
927 Certificate to be returned as mock enrollment result.
929 =item B<-rsp_extracerts> I<filenames>
931 Extra certificates to be included in mock certification responses.
933 =item B<-rsp_capubs> I<filenames>
935 CA certificates to be included in mock Initialization Response (IP) message.
937 =item B<-poll_count> I<number>
939 Number of times the client must poll before receiving a certificate.
941 =item B<-check_after> I<number>
943 The checkAfter value (number of seconds to wait) to include in poll response.
946 =item B<-grant_implicitconf>
948 Grant implicit confirmation of newly enrolled certificate.
950 =item B<-pkistatus> I<number>
952 PKIStatus to be included in server response.
953 Valid range is 0 (accepted) .. 6 (keyUpdateWarning).
955 =item B<-failure> I<number>
957 A single failure info bit number to be included in server response.
958 Valid range is 0 (badAlg) .. 26 (duplicateCertReq).
960 =item B<-failurebits> I<number>
961 Number representing failure bits to be included in server response.
962 Valid range is 0 .. 2^27 - 1.
964 =item B<-statusstring> I<arg>
966 Text to be included as status string in server response.
970 Force server to reply with error message.
972 =item B<-send_unprotected>
974 Send response messages without CMP-level protection.
976 =item B<-send_unprot_err>
978 In case of negative responses, server shall send unprotected error messages,
979 certificate responses (IP/CP/KUP), and revocation responses (RP).
980 WARNING: This setting leads to behavior violating RFC 4210.
982 =item B<-accept_unprotected>
984 Accept missing or invalid protection of requests.
986 =item B<-accept_unprot_err>
988 Accept unprotected error messages from client.
990 =item B<-accept_raverified>
992 Accept RAVERIFED as proof-of-possession (POPO).
999 When setting up CMP configurations and experimenting with enrollment options
1000 typically various errors occur until the configuration is correct and complete.
1001 When the CMP server reports an error the client will by default
1002 check the protection of the CMP response message.
1003 Yet some CMP services tend not to protect negative responses.
1004 In this case the client will reject them, and thus their contents are not shown
1005 although they usually contain hints that would be helpful for diagnostics.
1006 For assisting in such cases the CMP client offers a workaround via the
1007 B<-unprotected_errors> option, which allows accepting such negative messages.
1012 =head2 Simple examples using the default OpenSSL configuration file
1014 This CMP client implementation comes with demonstrative CMP sections
1015 in the example configuration file F<openssl/apps/openssl.cnf>,
1016 which can be used to interact conveniently with the Insta Demo CA.
1018 In order to enroll an initial certificate from that CA it is sufficient
1019 to issue the following shell commands.
1022 export OPENSSL_CONF=openssl.cnf
1024 wget 'http://pki.certificate.fi:8080/install-ca-cert.html/ca-certificate.crt\
1025 ?ca-id=632&download-certificate=1' -O insta.ca.crt
1027 openssl genrsa -out insta.priv.pem
1028 openssl cmp -section insta
1030 This should produce the file F<insta.cert.pem> containing a new certificate
1031 for the private key held in F<insta.priv.pem>.
1032 It can be viewed using, e.g.,
1034 openssl x509 -noout -text -in insta.cert.pem
1036 In case the network setup requires using an HTTP proxy it may be given as usual
1037 via the environment variable B<http_proxy> or via the B<proxy> option or
1038 the CMP command-line argument B<-proxy>, for example
1040 -proxy http://192.168.1.1:8080
1042 In the Insta Demo CA scenario both clients and the server may use the pre-shared
1043 secret I<insta> and the reference value I<3078> to authenticate to each other.
1045 Alternatively, CMP messages may be protected in signature-based manner,
1046 where the trust anchor in this case is F<insta.ca.crt>
1047 and the client may use any certificate already obtained from that CA,
1048 as specified in the B<[signature]> section of the example configuration.
1049 This can be used in combination with the B<[insta]> section simply by
1051 openssl cmp -section insta,signature
1053 By default the CMP IR message type is used, yet CR works equally here.
1054 This may be specified directly at the command line:
1056 openssl cmp -section insta -cmd cr
1058 or by referencing in addition the B<[cr]> section of the example configuration:
1060 openssl cmp -section insta,cr
1062 In order to update the enrolled certificate one may call
1064 openssl cmp -section insta,kur
1066 using with PBM-based protection or
1068 openssl cmp -section insta,kur,signature
1070 using signature-based protection.
1072 In a similar way any previously enrolled certificate may be revoked by
1074 openssl cmp -section insta,rr -trusted insta.ca.crt
1078 openssl cmp -section insta,rr,signature
1080 Many more options can be used in the configuration file
1081 and/or on the command line.
1082 For instance, the B<-reqexts> CLI option may refer to a section in the
1083 configuration file defining X.509 extensions to use in certificate requests,
1084 such as B<v3_req> in F<openssl/apps/openssl.cnf>:
1086 openssl cmp -section insta,cr -reqexts v3_req
1088 =head2 Certificate enrollment
1090 The following examples at first do not make use of a configuration file.
1091 They assume that a CMP server can be contacted on the local TCP port 80
1092 and accepts requests under the alias I</pkix/>.
1094 For enrolling its very first certificate the client generates a first client key
1095 and sends an initial request message to the local CMP server
1096 using a pre-shared secret key for mutual authentication.
1097 In this example the client does not have the CA certificate yet,
1098 so we specify the name of the CA with the B<-recipient> option
1099 and save any CA certificates that we may receive in the C<capubs.pem> file.
1101 In below command line usage examples the C<\> at line ends is just used
1102 for formatting; each of the command invocations should be on a single line.
1104 openssl genrsa -out cl_key.pem
1105 openssl cmp -cmd ir -server 127.0.0.1:80 -path pkix/ \
1106 -ref 1234 -secret pass:1234-5678-1234-5678 \
1107 -recipient "/CN=CMPserver" \
1108 -newkey cl_key.pem -subject "/CN=MyName" \
1109 -cacertsout capubs.pem -certout cl_cert.pem
1112 =head2 Certificate update
1114 Then, when the client certificate and its related key pair needs to be updated,
1115 the client can send a key update request taking the certs in C<capubs.pem>
1116 as trusted for authenticating the server and using the previous cert and key
1117 for its own authentication.
1118 Then it can start using the new cert and key.
1120 openssl genrsa -out cl_key_new.pem
1121 openssl cmp -cmd kur -server 127.0.0.1:80 -path pkix/ \
1122 -trusted capubs.pem \
1123 -cert cl_cert.pem -key cl_key.pem \
1124 -newkey cl_key_new.pem -certout cl_cert.pem
1125 cp cl_key_new.pem cl_key.pem
1127 This command sequence can be repated as often as needed.
1130 =head2 Requesting information from CMP server
1132 Requesting "all relevant information" with an empty General Message.
1133 This prints information about all received ITAV B<infoType>s to stdout.
1135 openssl cmp -cmd genm -server 127.0.0.1 -path pkix/ \
1136 -ref 1234 -secret pass:1234-5678-1234-5678 \
1137 -recipient "/CN=CMPserver"
1140 =head2 Using a custom configuration file
1142 For CMP client invocations, in particular for certificate enrollment,
1143 usually many parameters need to be set, which is tedious and error-prone to do
1144 on the command line.
1145 Therefore, the client offers the possibility to read
1146 options from sections of the OpenSSL config file, usually called B<openssl.cnf>.
1147 The values found there can still be extended and even overridden by any
1148 subsequently loaded sections and on the command line.
1150 After including in the configuration file the following sections:
1155 trusted = capubs.pem
1159 certout = cl_cert.pem
1162 recipient = "/CN=CMPserver"
1167 secret = pass:1234-5678-1234-567
1168 subject = "/CN=MyName"
1169 cacertsout = capubs.pem
1171 the above enrollment invocations reduce to
1173 openssl cmp -section cmp,cmp-init
1174 openssl cmp -cmd kur -newkey cl_key_new.pem
1176 and the above genm call reduces to
1178 openssl cmp -section cmp,cmp-init -cmd genm
1182 L<openssl-genrsa(1)>, L<openssl-ecparam(1)>, L<openssl-list(1)>,
1183 L<openssl-req(1)>, L<openssl-x509(1)>, L<x509v3_config(5)>
1187 Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
1189 Licensed under the OpenSSL license (the "License"). You may not use
1190 this file except in compliance with the License. You can obtain a copy
1191 in the file LICENSE in the source distribution or at
1192 L<https://www.openssl.org/source/license.html>.