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<address[:port]>]
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>]
39 [B<-extracerts> I<sources>]
40 [B<-unprotected_requests>]
42 [B<-cmd> I<ir|cr|kur|p10cr|rr|genm>]
43 [B<-infotype> I<name>]
44 [B<-geninfo> I<OID:int:N>]
46 [B<-newkey> I<filename>]
47 [B<-newkeypass> I<arg>]
54 [B<-policies> I<name>]
55 [B<-policy_oids> I<names>]
56 [B<-policy_oids_critical>]
59 [B<-out_trusted> I<filenames>]
60 [B<-verify_hostname> I<cn>]
62 [B<-verify_email> I<email>]
63 [B<-implicit_confirm>]
65 [B<-certout> I<filename>]
67 [B<-oldcert> I<filename>]
68 [B<-revreason> I<number>]
70 [B<-certform> I<PEM|DER>]
71 [B<-keyform> I<PEM|DER|P12|ENGINE>]
72 [B<-certsform> I<PEM|DER|P12>]
73 [B<-otherpass> I<arg>]
74 {- $OpenSSL::safe::opt_engine_synopsis -}
75 {- $OpenSSL::safe::opt_provider_synopsis -}
78 [B<-tls_cert> I<filename>]
79 [B<-tls_key> I<filename>]
80 [B<-tls_keypass> I<arg>]
81 [B<-tls_extra> I<filenames>]
82 [B<-tls_trusted> I<filenames>]
83 [B<-tls_host> I<name>]
86 [B<-repeat> I<number>]
87 [B<-reqin>] I<filenames>
89 [B<-reqout>] I<filenames>
90 [B<-rspin>] I<filenames>
91 [B<-rspout>] I<filenames>
95 [B<-purpose> I<purpose>]
96 [B<-verify_name> I<name>]
97 [B<-verify_depth> I<num>]
98 [B<-auth_level> I<level>]
99 [B<-attime> I<timestamp>]
100 [B<-ignore_critical>]
103 [B<-explicit_policy>]
114 [B<-suiteB_128_only>]
120 [B<-allow_proxy_certs>]
123 [B<-max_msgs> I<number>]
124 [B<-srv_ref> I<value>]
125 [B<-srv_secret> I<arg>]
126 [B<-srv_cert> I<filename>]
127 [B<-srv_key> I<filename>]
128 [B<-srv_keypass> I<arg>]
129 [B<-srv_trusted> I<filenames>]
130 [B<-srv_untrusted> I<filenames>]
131 [B<-rsp_cert> I<filename>]
132 [B<-rsp_extracerts> I<filenames>]
133 [B<-rsp_capubs> I<filenames>]
134 [B<-poll_count> I<number>]
135 [B<-check_after> I<number>]
136 [B<-grant_implicitconf>]
137 [B<-pkistatus> I<number>]
138 [B<-failure> I<number>]
139 [B<-failurebits> I<number>]
140 [B<-statusstring> I<arg>]
142 [B<-send_unprotected>]
143 [B<-send_unprot_err>]
144 [B<-accept_unprotected>]
145 [B<-accept_unprot_err>]
146 [B<-accept_raverified>]
150 The B<cmp> command is a client implementation for the Certificate
151 Management Protocol (CMP) as defined in RFC4210.
152 It can be used to request certificates from a CA server,
153 update their certificates,
154 request certificates to be revoked, and perform other types of CMP requests.
162 Display a summary of all options
164 =item B<-config> I<filename>
166 Configuration file to use.
167 An empty string C<""> means none.
168 Default filename is from the environment variable C<OPENSSL_CONF>.
170 =item B<-section> I<names>
172 Section(s) to use within config file defining CMP options.
173 An empty string C<""> means no specific section.
175 Multiple section names may be given, separated by commas and/or whitespace
176 (where in the latter case the whole argument must be enclosed in "...").
177 Contents of sections named later may override contents of sections named before.
178 In any case, as usual, the C<[default]> section and finally the unnamed
179 section (as far as present) can provide per-option fallback values.
184 =head2 Generic message options
188 =item B<-cmd> I<ir|cr|kur|p10cr|rr|genm>
190 CMP command to execute.
191 Currently implemented commands are:
195 =item ir E<nbsp> - Initialization Request
197 =item cr E<nbsp> - Certificate Request
199 =item p10cr - PKCS#10 Certification Request (for legacy support)
201 =item kur E<nbsp>E<nbsp>- Key Update Request
203 =item rr E<nbsp> - Revocation Request
205 =item genm - General Message
209 B<ir> requests initialization of an End Entity into a PKI hierarchy
210 by issuing a first certificate.
212 B<cr> requests issuing an additional certificate for an End Entity already
213 initialized to the PKI hierarchy.
215 B<p10cr> requests issuing an additional certificate similarly to B<cr>
216 but uses PKCS#10 CSR format.
218 B<kur> requests a (key) update for an existing, given certificate.
220 B<rr> requests revocation of an existing, given certificate.
222 B<genm> requests information using a General Message, where optionally
223 included B<InfoTypeAndValue>s may be used to state which info is of interest.
224 Upon receipt of the General Response, information about all received
225 ITAV B<infoType>s is printed to stdout.
227 =item B<-infotype> I<name>
229 Set InfoType name to use for requesting specific info in B<genm>,
230 e.g., C<signKeyPairTypes>.
232 =item B<-geninfo> I<OID:int:N>
234 generalInfo integer values to place in request PKIHeader with given OID,
235 e.g., C<1.2.3:int:987>.
240 =head2 Certificate request options
244 =item B<-newkey> I<filename>
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.
252 =item B<-newkeypass> I<arg>
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.
257 For more information about the format of B<arg> see the
258 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
260 =item B<-subject> I<name>
262 X509 Distinguished Name (DN) of subject to use in the requested certificate
264 For KUR, it defaults to the subject DN of the reference certificate
266 This default is used for IR and CR only if no SANs are set.
268 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
269 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
271 The subject DN is also used as fallback sender of outgoing CMP messages
272 if no B<-cert> and no B<-oldcert> are given.
274 =item B<-issuer> I<name>
276 X509 issuer Distinguished Name (DN) of the CA server
277 to place in the requested certificate template in IR/CR/KUR.
279 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
280 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
282 If neither B<-srvcert> nor B<-recipient> is available,
283 the name given in this option is also set as the recipient of the CMP message.
285 =item B<-days> I<number>
287 Number of days the new certificate is requested to be valid for, counting from
288 the current time of the host.
289 Also triggers the explicit request that the
290 validity period starts from the current time (as seen by the host).
292 =item B<-reqexts> I<name>
294 Name of section in OpenSSL config file defining certificate request extensions.
296 =item B<-sans> I<spec>
298 One or more IP addresses, DNS names, or URIs separated by commas or whitespace
299 (where in the latter case the whole argument must be enclosed in "...")
300 to add as Subject Alternative Name(s) (SAN) certificate request extension.
301 If the special element "critical" is given the SANs are flagged as critical.
302 Cannot be used if any Subject Alternative Name extension is set via B<-reqexts>.
304 =item B<-san_nodefault>
306 When Subject Alternative Names are not given via B<-sans>
307 nor defined via B<-reqexts>,
308 they are copied by default from the reference certificate (see B<-oldcert>).
309 This can be disabled by giving the B<-san_nodefault> option.
311 =item B<-policies> I<name>
313 Name of section in OpenSSL config file defining policies to be set
314 as certificate request extension.
315 This option cannot be used together with B<-policy_oids>.
317 =item B<-policy_oids> I<names>
319 One or more OID(s), separated by commas and/or whitespace
320 (where in the latter case the whole argument must be enclosed in "...")
321 to add as certificate policies request extension.
322 This option cannot be used together with B<-policies>.
324 =item B<-policy_oids_critical>
326 Flag the policies given with B<-policy_oids> as critical.
328 =item B<-popo> I<number>
330 Proof-of-Possession (POPO) method to use for IR/CR/KUR; values: C<-1>..<2> where
331 C<-1> = NONE, C<0> = RAVERIFIED, C<1> = SIGNATURE (default), C<2> = KEYENC.
333 Note that a signature-based POPO can only be produced if a private key
334 is provided via the B<-newkey> or B<-key> options.
336 =item B<-csr> I<filename>
338 CSR in PKCS#10 format to use in legacy P10CR messages.
340 =item B<-out_trusted> I<filenames>
342 Trusted certificate(s) to use for verifying the newly enrolled certificate.
344 Multiple filenames may be given, separated by commas and/or whitespace
345 (where in the latter case the whole argument must be enclosed in "...").
346 Each source may contain multiple certificates.
348 =item B<-verify_hostname> I<name>
350 When verification of the newly enrolled certificate is enabled (with the
351 B<-out_trusted> option), check if any DNS Subject Alternative Name (or if no
352 DNS SAN is included, the Common Name in the subject) equals the given B<name>.
354 =item B<-verify_ip> I<ip>
356 When verification of the newly enrolled certificate is enabled (with the
357 B<-out_trusted> option), check if there is
358 an IP address Subject Alternative Name matching the given IP address.
360 =item B<-verify_email> I<email>
362 When verification of the newly enrolled certificate is enabled (with the
363 B<-out_trusted> option), check if there is
364 an email address Subject Alternative Name matching the given email address.
366 =item B<-implicit_confirm>
368 Request implicit confirmation of newly enrolled certificates.
370 =item B<-disable_confirm>
372 Do not send certificate confirmation message for newly enrolled certificate
373 without requesting implicit confirmation
374 to cope with broken servers not supporting implicit confirmation correctly.
375 B<WARNING:> This leads to behavior violating RFC 4210.
377 =item B<-certout> I<filename>
379 The file where the newly enrolled certificate should be saved.
384 =head2 Certificate revocation options
388 =item B<-oldcert> I<filename>
390 The certificate to be updated (i.e., renewed or re-keyed) in Key Update Request
391 (KUR) messages or to be revoked in Revocation Request (RR) messages.
392 It must be given for RR, while for KUR it defaults to B<-cert>.
394 The reference certificate determined in this way, if any, is also used for
395 deriving default subject DN and Subject Alternative Names for IR, CR, and KUR.
396 Its subject is used as sender of outgoing messages if B<-cert> is not given.
397 Its issuer is used as default recipient in CMP message headers
398 if neither B<-recipient>, B<-srvcert>, nor B<-issuer> is given.
400 =item B<-revreason> I<number>
402 Set CRLReason to be included in revocation request (RR); values: C<0>..C<10>
403 or C<-1> for none (which is the default).
405 Reason numbers defined in RFC 5280 are:
407 CRLReason ::= ENUMERATED {
411 affiliationChanged (3),
413 cessationOfOperation (5),
415 -- value 7 is not used
417 privilegeWithdrawn (9),
424 =head2 Message transfer options
428 =item B<-server> I<[http[s]://]address[:port]>
430 The IP address or DNS hostname and optionally port (defaulting to 80 or 443)
431 of the CMP server to connect to using HTTP(S) transport.
432 The optional I<http://> or I<https://> prefix is ignored.
434 =item B<-proxy> I<[http[s]://]address[:port][/path]>
436 The HTTP(S) proxy server to use for reaching the CMP server unless B<no_proxy>
438 The optional I<http://> or I<https://> prefix and any trailing path are ignored.
439 Defaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY>
440 in case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>.
442 =item B<-no_proxy> I<addresses>
443 List of IP addresses and/or DNS names of servers
444 not to use an HTTP(S) proxy for, separated by commas and/or whitespace
445 (where in the latter case the whole argument must be enclosed in "...").
446 Default is from the environment variable C<no_proxy> if set, else C<NO_PROXY>.
448 =item B<-path> I<remote_path>
450 HTTP path at the CMP server (aka CMP alias) to use for POST requests.
453 =item B<-msg_timeout> I<seconds>
455 Number of seconds (or 0 for infinite) a CMP request-response message round trip
456 is allowed to take before a timeout error is returned.
459 =item B<-total_timeout> I<seconds>
461 Maximum number seconds an overall enrollment transaction may take,
462 including attempts polling for certificates on C<waiting> PKIStatus.
463 Default is 0 (infinite).
468 =head2 Server authentication options
472 =item B<-trusted> I<filenames>
474 When verifying signature-based protection of CMP response messages,
475 these are the CA certificate(s) to trust while checking certificate chains
476 during CMP server authentication.
477 This option gives more flexibility than the B<-srvcert> option because the
478 protection certificate is not pinned but may be any certificate
479 for which a chain to one of the given trusted certificates can be constructed.
481 Multiple filenames may be given, separated by commas and/or whitespace
482 (where in the latter case the whole argument must be enclosed in "...").
483 Each source may contain multiple certificates.
485 =item B<-untrusted> I<sources>
487 Non-trusted intermediate CA certificate(s) that may be useful for cert path
488 construction for the CMP client certificate (to include in the extraCerts field
489 of outgoing messages), for the TLS client certificate (if TLS is enabled),
490 when verifying the CMP server certificate (checking signature-based
491 CMP message protection), and when verifying newly enrolled certificates.
493 Multiple filenames may be given, separated by commas and/or whitespace.
494 Each file may contain multiple certificates.
496 =item B<-srvcert> I<filename>
498 The specific CMP server certificate to expect and directly trust (even if it is
499 expired) when verifying signature-based protection of CMP response messages.
500 May be set alternatively to the B<-trusted> option to pin the accepted server.
502 If set, the subject of the certificate is also used
503 as default value for the recipient of CMP requests
504 and as default value for the expected sender of incoming CMP messages.
506 =item B<-recipient> I<name>
508 Distinguished Name (DN) to use in the recipient field of CMP request messages,
509 i.e., the CMP server (usually a CA or RA entity).
511 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
512 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
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.
522 =item B<-expect_sender> I<name>
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.
527 The argument must be formatted as I</type0=value0/type1=value1/type2=...>,
528 characters may be escaped by C<\>E<nbsp>(backslash), no spaces are skipped.
530 This can be used to make sure that only a particular entity is accepted as
531 CMP message signer, and attackers are not able to use arbitrary certificates
532 of a trusted PKI hierarchy to fraudulently pose as a CMP server.
533 Note that this option gives slightly more freedom than setting the B<-srvcert>,
534 which pins the server to the holder of a particular certificate, while the
535 expected sender name will continue to match after updates of the server cert.
537 =item B<-ignore_keyusage>
539 Ignore key usage restrictions in CMP signer certificates when verifying
540 signature-based protection of incoming CMP messages,
541 else C<digitalSignature> must be allowed for signer certificate.
543 =item B<-unprotected_errors>
545 Accept missing or invalid protection of negative responses from the server.
546 This applies to the following message types and contents:
550 =item * error messages
552 =item * negative certificate responses (IP/CP/KUP)
554 =item * negative revocation responses (RP)
556 =item * negative PKIConf messages
560 B<WARNING:> This setting leads to unspecified behavior and it is meant
561 exclusively to allow interoperability with server implementations violating
566 =item * section 5.1.3.1 allows exceptions from protecting only for special
568 "There MAY be cases in which the PKIProtection BIT STRING is deliberately not
569 used to protect a message [...] because other protection, external to PKIX, will
572 =item * section 5.3.21 is clear on ErrMsgContent: "The CA MUST always sign it
573 with a signature key."
575 =item * appendix D.4 shows PKIConf message having protection
579 =item B<-extracertsout> I<filename>
581 The file where to save any extra certificates received in the extraCerts field
582 of response messages.
584 =item B<-cacertsout> I<filename>
586 The file where to save any CA certificates received in the caPubs field of
587 Initialization Response (IP) messages.
592 =head2 Client authentication options
596 =item B<-ref> I<value>
598 Reference number/string/value to use as fallback senderKID; this is required
599 if no sender name can be determined from the B<-cert> or <-subject> options and
600 is typically used when authenticating with pre-shared key (password-based MAC).
602 =item B<-secret> I<arg>
604 Source of secret value to use for creating PBM-based protection of outgoing
605 messages and for verifying any PBM-based protection of incoming messages.
606 PBM stands for Password-Based Message Authentication Code.
607 This takes precedence over the B<-cert> option.
609 For more information about the format of B<arg> see the
610 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
612 =item B<-cert> I<filename>
614 The client's current certificate.
615 Requires the corresponding key to be given with B<-key>.
616 The subject of this certificate will be used as sender of outgoing CMP messages,
617 while the subject of B<-oldcert> or B<-subjectName> may provide fallback values.
618 When using signature-based message protection, this "protection certificate"
619 will be included first in the extraCerts field of outgoing messages.
620 In Initialization Request (IR) messages this can be used for authenticating
621 using an external entity certificate as defined in appendix E.7 of RFC 4210.
622 For Key Update Request (KUR) messages this is also used as
623 the certificate to be updated if the B<-oldcert> option is not given.
624 If the file includes further certs, they are appended to the untrusted certs.
626 =item B<-key> I<filename>
628 The corresponding private key file for the client's current certificate given in
630 This will be used for signature-based message protection unless
631 the B<-secret> option indicating PBM or B<-unprotected_requests> is given.
633 =item B<-keypass> I<arg>
635 Pass phrase source for the private key given with the B<-key> option.
636 Also used for B<-cert> and B<-oldcert> in case it is an encrypted PKCS#12 file.
637 If not given here, the password will be prompted for if needed.
639 For more information about the format of B<arg> see the
640 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
642 =item B<-digest> I<name>
644 Specifies name of supported digest to use in RFC 4210's MSG_SIG_ALG
645 and as the one-way function (OWF) in MSG_MAC_ALG.
646 If applicable, this is used for message protection and
647 Proof-of-Possession (POPO) signatures.
648 To see the list of supported digests, use B<openssl list -digest-commands>.
649 Defaults to C<sha256>.
651 =item B<-mac> I<name>
653 Specifies the name of the MAC algorithm in MSG_MAC_ALG.
654 To get the names of supported MAC algorithms use B<openssl list -mac-algorithms>
655 and possibly combine such a name with the name of a supported digest algorithm,
656 e.g., hmacWithSHA256.
657 Defaults to C<hmac-sha1> as per RFC 4210.
659 =item B<-extracerts> I<sources>
661 Certificates to append in the extraCerts field when sending messages.
663 Multiple filenames or URLs may be given, separated by commas and/or whitespace
664 (where in the latter case the whole argument must be enclosed in "...").
665 Each source may contain multiple certificates.
667 =item B<-unprotected_requests>
669 Send messages without CMP-level protection.
674 =head2 Credentials format options
678 =item B<-certform> I<PEM|DER>
680 File format to use when saving a certificate to a file.
681 Default value is PEM.
683 =item B<-keyform> I<PEM|DER|P12>
685 Format to assume when reading key files.
686 Default value is PEM.
688 =item B<-certsform> I<PEM|DER|P12>
690 Format to try first when reading multiple certificates from file(s).
691 Default value is PEM.
693 =item B<-otherpass> I<arg>
695 Pass phrase source for certificate given with the B<-trusted>, B<-untrusted>,
696 B<-out_trusted>, B<-extracerts>, B<-tls_extra>, or B<-tls_trusted> options.
697 If not given here, the password will be prompted for if needed.
699 For more information about the format of B<arg> see the
700 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
701 {- output_off() if $disabled{"deprecated-3.0"}; "" -}
703 =item B<-engine> I<id>
705 Specifying a crypto engine B<id> will lead to obtaining a functional
706 reference to the specified engine, initializing it if needed.
707 The engine will be used for all algorithms supported for keys
708 prefixed by C<engine:>.
709 Engines may be defined in the OpenSSL config file as usual in an engine section.
711 Options specifying keys, like B<-key>, B<-newkey>, B<-tls_key> can prefix
712 C<engine:> to engine-specific identifiers for security tokens objects held by
714 The following example utilizes the RFC 7512 PKCS #11 URI scheme
715 as supported, e.g., by libp11:
716 C<-key engine:pkcs11:object=my-private-key;type=private;pin-value=1234>
718 {- output_on() if $disabled{"deprecated-3.0"}; "" -}
719 {- $OpenSSL::safe::opt_provider_item -}
730 Enable using TLS (even when other TLS_related options are not set)
731 when connecting to CMP server.
733 =item B<-tls_cert> I<filename>
735 Client's TLS certificate.
736 If the file includes further certs they are used (along with B<-untrusted>
737 certs) for constructing the client cert chain provided to the TLS server.
739 =item B<-tls_key> I<filename>
741 Private key for the client's TLS certificate.
743 =item B<-tls_keypass> I<arg>
745 Pass phrase source for client's private TLS key B<tls_key>.
746 Also used for B<-tls_cert> in case it is an encrypted PKCS#12 file.
747 If not given here, the password will be prompted for if needed.
749 For more information about the format of B<arg> see the
750 B<PASS PHRASE ARGUMENTS> section in L<openssl(1)>.
752 =item B<-tls_extra> I<filenames>
754 Extra certificates to provide to TLS server during TLS handshake
756 =item B<-tls_trusted> I<filenames>
758 Trusted certificate(s) to use for verifying the TLS server certificate.
759 This implies hostname validation.
761 Multiple filenames may be given, separated by commas and/or whitespace
762 (where in the latter case the whole argument must be enclosed in "...").
763 Each source may contain multiple certificates.
765 =item B<-tls_host> I<name>
767 Address to be checked during hostname validation.
768 This may be a DNS name or an IP address.
769 If not given it defaults to the B<-server> address.
774 =head2 Client-side debugging options
780 Do not interactively prompt for input, for instance when a password is needed.
781 This can be useful for batch processing and testing.
783 =item B<-repeat> I<number>
785 Invoke the command the given number of times with the same parameters.
786 Default is one invocation.
788 =item B<-reqin> I<filenames>
790 Take sequence of CMP requests from file(s).
791 Multiple filenames may be given, separated by commas and/or whitespace
792 (where in the latter case the whole argument must be enclosed in "...").
793 As many files are read as needed for a complete transaction.
795 =item B<-reqin_new_tid>
797 Use a fresh transactionID for CMP request messages read using B<-reqin>,
798 which requires re-protecting them as far as they were protected before.
799 This may be needed in case the sequence of requests is reused
800 and the CMP server complains that the transaction ID has already been used.
802 =item B<-reqout> I<filenames>
804 Save sequence of CMP requests to file(s).
805 Multiple filenames may be given, separated by commas and/or whitespace.
806 As many files are written as needed to store the complete transaction.
808 =item B<-rspin> I<filenames>
810 Process sequence of CMP responses provided in file(s), skipping server.
811 Multiple filenames may be given, separated by commas and/or whitespace.
812 As many files are read as needed for the complete transaction.
814 =item B<-rspout> I<filenames>
816 Save sequence of CMP responses to file(s).
817 Multiple filenames may be given, separated by commas and/or whitespace.
818 As many files are written as needed to store the complete transaction.
820 =item B<-use_mock_srv>
822 Use the internal mock server for testing the client.
823 This works at API level, bypassing HTTP transport.
828 =head2 Certificate verification options, for both CMP and TLS
832 =item B<-policy>, B<-purpose>, B<-verify_name>, B<-verify_depth>,
834 B<-ignore_critical>, B<-issuer_checks>,
836 B<-explicit_policy>, B<-inhibit_any>, B<-inhibit_map>,
837 B<-x509_strict>, B<-extended_crl>, B<-use_deltas>,
838 B<-policy_print>, B<-check_ss_sig>, B<-crl_check>, B<-crl_check_all>,
840 B<-suiteB_128_only>, B<-suiteB_128>, B<-suiteB_192>,
841 B<-partial_chain>, B<-no_alt_chains>, B<-no_check_time>,
843 B<-allow_proxy_certs>
845 Set various options of certificate chain verification.
846 See L<openssl(1)/Verification Options> for details.
851 =head2 Mock server options, for testing purposes only
855 =item B<-port> I<number>
857 Act as CMP HTTP server mock-up listening on the given port.
859 =item B<-max_msgs> I<number>
861 Maximum number of CMP (request) messages the CMP HTTP server mock-up
862 should handle, which must be non-negative.
863 The default value is 0, which means that no limit is imposed.
864 In any case the server terminates on internal errors, but not when it
865 detects a CMP-level error that it can successfully answer with an error message.
867 =item B<-srv_ref> I<value>
869 Reference value to use as senderKID of server in case no B<-srv_cert> is given.
871 =item B<-srv_secret> I<arg>
873 Password source for server authentication with a pre-shared key (secret).
875 =item B<-srv_cert> I<filename>
877 Certificate of the server.
879 =item B<-srv_key> I<filename>
881 Private key used by the server for signing messages.
883 =item B<-srv_keypass> I<arg>
885 Server private key (and cert) file pass phrase source.
887 =item B<-srv_trusted> I<filenames>
889 Trusted certificates for client authentication.
891 =item B<-srv_untrusted> I<filenames>
893 Intermediate CA certs that may be useful when verifying client certificates.
895 =item B<-rsp_cert> I<filename>
897 Certificate to be returned as mock enrollment result.
899 =item B<-rsp_extracerts> I<filenames>
901 Extra certificates to be included in mock certification responses.
903 =item B<-rsp_capubs> I<filenames>
905 CA certificates to be included in mock Initialization Response (IP) message.
907 =item B<-poll_count> I<number>
909 Number of times the client must poll before receiving a certificate.
911 =item B<-check_after> I<number>
913 The checkAfter value (number of seconds to wait) to include in poll response.
916 =item B<-grant_implicitconf>
918 Grant implicit confirmation of newly enrolled certificate.
920 =item B<-pkistatus> I<number>
922 PKIStatus to be included in server response.
923 Valid range is 0 (accepted) .. 6 (keyUpdateWarning).
925 =item B<-failure> I<number>
927 A single failure info bit number to be included in server response.
928 Valid range is 0 (badAlg) .. 26 (duplicateCertReq).
930 =item B<-failurebits> I<number>
931 Number representing failure bits to be included in server response.
932 Valid range is 0 .. 2^27 - 1.
934 =item B<-statusstring> I<arg>
936 Text to be included as status string in server response.
940 Force server to reply with error message.
942 =item B<-send_unprotected>
944 Send response messages without CMP-level protection.
946 =item B<-send_unprot_err>
948 In case of negative responses, server shall send unprotected error messages,
949 certificate responses (IP/CP/KUP), and revocation responses (RP).
950 WARNING: This setting leads to behavior violating RFC 4210.
952 =item B<-accept_unprotected>
954 Accept missing or invalid protection of requests.
956 =item B<-accept_unprot_err>
958 Accept unprotected error messages from client.
960 =item B<-accept_raverified>
962 Accept RAVERIFED as proof-of-possession (POPO).
969 When setting up CMP configurations and experimenting with enrollment options
970 typically various errors occur until the configuration is correct and complete.
971 When the CMP server reports an error the client will by default
972 check the protection of the CMP response message.
973 Yet some CMP services tend not to protect negative responses.
974 In this case the client will reject them, and thus their contents are not shown
975 although they usually contain hints that would be helpful for diagnostics.
976 For assisting in such cases the CMP client offers a workaround via the
977 B<-unprotected_errors> option, which allows accepting such negative messages.
982 =head2 Simple examples using the default OpenSSL configuration file
984 This CMP client implementation comes with demonstrative CMP sections
985 in the example configuration file F<openssl/apps/openssl.cnf>,
986 which can be used to interact conveniently with the Insta Demo CA.
988 In order to enroll an initial certificate from that CA it is sufficient
989 to issue the following shell commands.
992 export OPENSSL_CONF=openssl.cnf
993 wget 'http://pki.certificate.fi:8080/install-ca-cert.html/ca-certificate.crt\
994 ?ca-id=632&download-certificate=1' -O insta.ca.crt
995 openssl genrsa -out insta.priv.pem
996 openssl cmp -section insta
998 This should produce the file F<insta.cert.pem> containing a new certificate
999 for the private key held in F<insta.priv.pem>.
1000 It can be viewed using, e.g.,
1002 openssl x509 -noout -text -in insta.cert.pem
1004 In case the network setup requires using an HTTP proxy it may be given as usual
1005 via the environment variable B<http_proxy> or via the B<proxy> option or
1006 the CMP command-line argument B<-proxy>, for example
1008 -proxy http://192.168.1.1:8080
1010 In the Insta Demo CA scenario both clients and the server may use the pre-shared
1011 secret I<insta> and the reference value I<3078> to authenticate to each other.
1013 Alternatively, CMP messages may be protected in signature-based manner,
1014 where the trust anchor in this case is F<insta.ca.crt>
1015 and the client may use any certificate already obtained from that CA,
1016 as specified in the B<[signature]> section of the example configuration.
1017 This can be used in combination with the B<[insta]> section simply by
1019 openssl cmp -section insta,signature
1021 By default the CMP IR message type is used, yet CR works equally here.
1022 This may be specified directly at the command line:
1024 openssl cmp -section insta -cmd cr
1026 or by referencing in addition the B<[cr]> section of the example configuration:
1028 openssl cmp -section insta,cr
1030 In order to update the enrolled certificate one may call
1032 openssl cmp -section insta,kur
1034 using with PBM-based protection or
1036 openssl cmp -section insta,kur,signature
1038 using signature-based protection.
1040 In a similar way any previously enrolled certificate may be revoked by
1042 openssl cmp -section insta,rr -trusted insta.ca.crt
1046 openssl cmp -section insta,rr,signature
1048 Many more options can be used in the configuration file
1049 and/or on the command line.
1052 =head2 Certificate enrollment
1054 The following examples at first do not make use of a configuration file.
1055 They assume that a CMP server can be contacted on the local TCP port 80
1056 and accepts requests under the alias I</pkix/>.
1058 For enrolling its very first certificate the client generates a first client key
1059 and sends an initial request message to the local CMP server
1060 using a pre-shared secret key for mutual authentication.
1061 In this example the client does not have the CA certificate yet,
1062 so we specify the name of the CA with the B<-recipient> option
1063 and save any CA certificates that we may receive in the C<capubs.pem> file.
1065 In below command line usage examples the C<\> at line ends is just used
1066 for formatting; each of the command invocations should be on a single line.
1068 openssl genrsa -out cl_key.pem
1069 openssl cmp -cmd ir -server 127.0.0.1:80 -path pkix/ \
1070 -ref 1234 -secret pass:1234-5678-1234-5678 \
1071 -recipient "/CN=CMPserver" \
1072 -newkey cl_key.pem -subject "/CN=MyName" \
1073 -cacertsout capubs.pem -certout cl_cert.pem
1076 =head2 Certificate update
1078 Then, when the client certificate and its related key pair needs to be updated,
1079 the client can send a key update request taking the certs in C<capubs.pem>
1080 as trusted for authenticating the server and using the previous cert and key
1081 for its own authentication.
1082 Then it can start using the new cert and key.
1084 openssl genrsa -out cl_key_new.pem
1085 openssl cmp -cmd kur -server 127.0.0.1:80 -path pkix/ \
1086 -trusted capubs.pem \
1087 -cert cl_cert.pem -key cl_key.pem \
1088 -newkey cl_key_new.pem -certout cl_cert.pem
1089 cp cl_key_new.pem cl_key.pem
1091 This command sequence can be repated as often as needed.
1094 =head2 Requesting information from CMP server
1096 Requesting "all relevant information" with an empty General Message.
1097 This prints information about all received ITAV B<infoType>s to stdout.
1099 openssl cmp -cmd genm -server 127.0.0.1 -path pkix/ \
1100 -ref 1234 -secret pass:1234-5678-1234-5678 \
1101 -recipient "/CN=CMPserver"
1104 =head2 Using a custom configuration file
1106 For CMP client invocations, in particular for certificate enrollment,
1107 usually many parameters need to be set, which is tedious and error-prone to do
1108 on the command line.
1109 Therefore, the client offers the possibility to read
1110 options from sections of the OpenSSL config file, usually called B<openssl.cnf>.
1111 The values found there can still be extended and even overridden by any
1112 subsequently loaded sections and on the command line.
1114 After including in the configuration file the following sections:
1119 trusted = capubs.pem
1123 certout = cl_cert.pem
1126 recipient = "/CN=CMPserver"
1131 secret = pass:1234-5678-1234-567
1132 subject = "/CN=MyName"
1133 cacertsout = capubs.pem
1135 the above enrollment invocations reduce to
1137 openssl cmp -section cmp,cmp-init
1138 openssl cmp -cmd kur -newkey cl_key_new.pem
1140 and the above genm call reduces to
1142 openssl cmp -section cmp,cmp-init -cmd genm
1146 L<openssl-genrsa(1)>, L<openssl-ecparam(1)>, L<openssl-list(1)>,
1147 L<openssl-req(1)>, L<openssl-x509(1)>, L<x509v3_config(5)>
1151 Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
1153 Licensed under the OpenSSL license (the "License"). You may not use
1154 this file except in compliance with the License. You can obtain a copy
1155 in the file LICENSE in the source distribution or at
1156 L<https://www.openssl.org/source/license.html>.