2 {- OpenSSL::safe::output_do_not_edit_headers(); -}
6 openssl-cmp - Certificate Management Protocol (CMP, RFC 4210) application
12 [B<-config> I<filename>]
13 [B<-section> I<names>]
14 [B<-verbosity> I<level>]
16 Generic message options:
18 [B<-cmd> I<ir|cr|kur|p10cr|rr|genm>]
19 [B<-infotype> I<name>]
20 [B<-geninfo> I<OID:int:N>]
22 Certificate enrollment options:
24 [B<-newkey> I<filename>|I<uri>]
25 [B<-newkeypass> I<arg>]
32 [B<-policies> I<name>]
33 [B<-policy_oids> I<names>]
34 [B<-policy_oids_critical>]
37 [B<-out_trusted> I<filenames>|I<uris>]
38 [B<-implicit_confirm>]
40 [B<-certout> I<filename>]
41 [B<-chainout> I<filename>]
43 Certificate enrollment and revocation options:
45 [B<-oldcert> I<filename>|I<uri>]
46 [B<-revreason> I<number>]
48 Message transfer options:
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>]
58 Server authentication options:
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>]
65 [B<-unprotected_errors>]
66 [B<-extracertsout> I<filename>]
67 [B<-cacertsout> I<filename>]
69 Client authentication and protection options:
73 [B<-cert> I<filename>|I<uri>]
74 [B<-own_trusted> I<filenames>|I<uris>]
75 [B<-key> I<filename>|I<uri>]
79 [B<-extracerts> I<filenames>|I<uris>]
80 [B<-unprotected_requests>]
82 Credentials format options:
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 -}
91 {- $OpenSSL::safe::opt_r_synopsis -}
93 TLS connection options:
96 [B<-tls_cert> I<filename>|I<uri>]
97 [B<-tls_key> I<filename>|I<uri>]
98 [B<-tls_keypass> I<arg>]
99 [B<-tls_extra> I<filenames>|I<uris>]
100 [B<-tls_trusted> I<filenames>|I<uris>]
101 [B<-tls_host> I<name>]
103 Client-side debugging options:
106 [B<-repeat> I<number>]
107 [B<-reqin> I<filenames>]
109 [B<-reqout> I<filenames>]
110 [B<-rspin> I<filenames>]
111 [B<-rspout> I<filenames>]
117 [B<-max_msgs> I<number>]
118 [B<-srv_ref> I<value>]
119 [B<-srv_secret> I<arg>]
120 [B<-srv_cert> I<filename>|I<uri>]
121 [B<-srv_key> I<filename>|I<uri>]
122 [B<-srv_keypass> I<arg>]
123 [B<-srv_trusted> I<filenames>|I<uris>]
124 [B<-srv_untrusted> I<filenames>|I<uris>]
125 [B<-rsp_cert> I<filename>|I<uri>]
126 [B<-rsp_extracerts> I<filenames>|I<uris>]
127 [B<-rsp_capubs> I<filenames>|I<uris>]
128 [B<-poll_count> I<number>]
129 [B<-check_after> I<number>]
130 [B<-grant_implicitconf>]
131 [B<-pkistatus> I<number>]
132 [B<-failure> I<number>]
133 [B<-failurebits> I<number>]
134 [B<-statusstring> I<arg>]
136 [B<-send_unprotected>]
137 [B<-send_unprot_err>]
138 [B<-accept_unprotected>]
139 [B<-accept_unprot_err>]
140 [B<-accept_raverified>]
142 Certificate verification options, for both CMP and TLS:
144 {- $OpenSSL::safe::opt_v_synopsis -}
146 =for openssl ifdef engine
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.
176 Multiple section names may be given, separated by commas and/or whitespace
177 (where in the latter case the whole argument must be enclosed in "...").
178 Contents of sections named later may override contents of sections named before.
179 In any case, as usual, the C<[default]> section and finally the unnamed
180 section (as far as present) can provide per-option fallback values.
182 =item B<-verbosity> I<level>
184 Level of verbosity for logging, error output, etc.
185 0 = EMERG, 1 = ALERT, 2 = CRIT, 3 = ERR, 4 = WARN, 5 = NOTE,
186 6 = INFO, 7 = DEBUG, 8 = TRACE.
187 Defaults to 6 = INFO.
191 =head2 Generic message options
195 =item B<-cmd> I<ir|cr|kur|p10cr|rr|genm>
197 CMP command to execute.
198 Currently implemented commands are:
202 =item ir E<nbsp> - Initialization Request
204 =item cr E<nbsp> - Certificate Request
206 =item p10cr - PKCS#10 Certification Request (for legacy support)
208 =item kur E<nbsp>E<nbsp>- Key Update Request
210 =item rr E<nbsp> - Revocation Request
212 =item genm - General Message
216 B<ir> requests initialization of an end entity into a PKI hierarchy
217 by issuing a first certificate.
219 B<cr> requests issuing an additional certificate for an end entity already
220 initialized to the PKI hierarchy.
222 B<p10cr> requests issuing an additional certificate similarly to B<cr>
223 but using legacy PKCS#10 CSR format.
225 B<kur> requests a (key) update for an existing certificate.
227 B<rr> requests revocation of an existing certificate.
229 B<genm> requests information using a General Message, where optionally
230 included B<InfoTypeAndValue>s may be used to state which info is of interest.
231 Upon receipt of the General Response, information about all received
232 ITAV B<infoType>s is printed to stdout.
234 =item B<-infotype> I<name>
236 Set InfoType name to use for requesting specific info in B<genm>,
237 e.g., C<signKeyPairTypes>.
239 =item B<-geninfo> I<OID:int:N>
241 generalInfo integer values to place in request PKIHeader with given OID,
242 e.g., C<1.2.3.4:int:56789>.
246 =head2 Certificate enrollment options
250 =item B<-newkey> I<filename>|I<uri>
252 The source of the private or public key for the certificate requested
253 in Initialization Request (IR), Certification Request(CR), or
254 Key Update Request (KUR).
255 Default is the public key in the PKCS#10 CSR given with the B<-csr> option,
256 if any, or else the current client key, if given.
258 =item B<-newkeypass> I<arg>
260 Pass phrase source for the key given with the B<-newkey> option.
261 If not given here, the password will be prompted for if needed.
263 For more information about the format of B<arg> see
264 L<openssl-passphrase-options(1)>.
266 =item B<-subject> I<name>
268 X509 Distinguished Name (DN) of subject to use in the requested certificate
270 For KUR, it defaults to the public key
271 in the PKCS#10 CSR given with the B<-csr> option, if provided,
272 or of the reference certificate (see B<-oldcert>) if provided.
273 This default is used for IR and CR only if no SANs are set.
274 If the NULL-DN (C<"/">) is given then no subject is placed in the template.
276 If provided and neither B<-cert> nor B<-oldcert> is given,
277 the subject DN is used as fallback sender of outgoing CMP messages.
279 The argument must be formatted as I</type0=value0/type1=value1/type2=...>.
280 Special characters may be escaped by C<\> (backslash); whitespace is retained.
281 Empty values are permitted, but the corresponding type will not be included.
282 Giving a single C</> will lead to an empty sequence of RDNs (a NULL-DN).
283 Multi-valued RDNs can be formed by placing a C<+> character instead of a C</>
284 between the AttributeValueAssertions (AVAs) that specify the members of the set.
287 C</DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe>
289 =item B<-issuer> I<name>
291 X509 issuer Distinguished Name (DN) of the CA server
292 to place in the requested certificate template in IR/CR/KUR.
293 If the NULL-DN (C<"/">) is given then no issuer is placed in the template.
295 If provided and neither B<-recipient> nor B<-srvcert> is given,
296 the issuer DN is used as fallback recipient of outgoing CMP messages.
298 The argument must be formatted as I</type0=value0/type1=value1/type2=...>.
299 For details see the description of the B<-subject> option.
301 =item B<-days> I<number>
303 Number of days the new certificate is requested to be valid for, counting from
304 the current time of the host.
305 Also triggers the explicit request that the
306 validity period starts from the current time (as seen by the host).
308 =item B<-reqexts> I<name>
310 Name of section in OpenSSL config file defining certificate request extensions.
311 If the B<-csr> option is present, these extensions augment the extensions
312 contained the given PKCS#10 CSR, overriding any extensions with same OIDs.
314 =item B<-sans> I<spec>
316 One or more IP addresses, DNS names, or URIs separated by commas or whitespace
317 (where in the latter case the whole argument must be enclosed in "...")
318 to add as Subject Alternative Name(s) (SAN) certificate request extension.
319 If the special element "critical" is given the SANs are flagged as critical.
320 Cannot be used if any Subject Alternative Name extension is set via B<-reqexts>.
322 =item B<-san_nodefault>
324 When Subject Alternative Names are not given via B<-sans>
325 nor defined via B<-reqexts>,
326 they are copied by default from the reference certificate (see B<-oldcert>).
327 This can be disabled by giving the B<-san_nodefault> option.
329 =item B<-policies> I<name>
331 Name of section in OpenSSL config file defining policies to be set
332 as certificate request extension.
333 This option cannot be used together with B<-policy_oids>.
335 =item B<-policy_oids> I<names>
337 One or more OID(s), separated by commas and/or whitespace
338 (where in the latter case the whole argument must be enclosed in "...")
339 to add as certificate policies request extension.
340 This option cannot be used together with B<-policies>.
342 =item B<-policy_oids_critical>
344 Flag the policies given with B<-policy_oids> as critical.
346 =item B<-popo> I<number>
348 Proof-of-Possession (POPO) method to use for IR/CR/KUR; values: C<-1>..<2> where
349 C<-1> = NONE, C<0> = RAVERIFIED, C<1> = SIGNATURE (default), C<2> = KEYENC.
351 Note that a signature-based POPO can only be produced if a private key
352 is provided via the B<-newkey> or B<-key> options.
354 =item B<-csr> I<filename>
356 PKCS#10 CSR in PEM or DER format containing a certificate request.
357 With B<-cmd> I<p10cr> it is used directly in a legacy P10CR message.
358 When used with B<-cmd> I<ir>, I<cr>, or I<kur>, it is transformed into the
359 respective regular CMP request.
360 It may also be used with B<-cmd> I<rr> to specify the certificate to be revoked
361 via the included subject name and public key.
363 =item B<-out_trusted> I<filenames>|I<uris>
365 Trusted certificate(s) to use for validating the newly enrolled certificate.
367 Multiple sources may be given, separated by commas and/or whitespace
368 (where in the latter case the whole argument must be enclosed in "...").
369 Each source may contain multiple certificates.
371 The certificate verification options
372 B<-verify_hostname>, B<-verify_ip>, and B<-verify_email>
373 only affect the certificate verification enabled via this option.
375 =item B<-implicit_confirm>
377 Request implicit confirmation of newly enrolled certificates.
379 =item B<-disable_confirm>
381 Do not send certificate confirmation message for newly enrolled certificate
382 without requesting implicit confirmation
383 to cope with broken servers not supporting implicit confirmation correctly.
384 B<WARNING:> This leads to behavior violating RFC 4210.
386 =item B<-certout> I<filename>
388 The file where the newly enrolled certificate should be saved.
390 =item B<-chainout> I<filename>
392 The file where the chain of the newly enrolled certificate should be saved.
396 =head2 Certificate enrollment and revocation options
400 =item B<-oldcert> I<filename>|I<uri>
402 The certificate to be updated (i.e., renewed or re-keyed) in Key Update Request
403 (KUR) messages or to be revoked in Revocation Request (RR) messages.
404 For KUR the certificate to be updated defaults to B<-cert>,
405 and the resulting certificate is called I<reference certificate>.
406 For RR the certificate to be revoked can also be specified using B<-csr>.
408 The reference certificate, if any, is also used for
409 deriving default subject DN and Subject Alternative Names and the
410 default issuer entry in the requested certificate template of an IR/CR/KUR.
411 Its subject is used as sender of outgoing messages if B<-cert> is not given.
412 Its issuer is used as default recipient in CMP message headers
413 if neither B<-recipient>, B<-srvcert>, nor B<-issuer> is given.
415 =item B<-revreason> I<number>
417 Set CRLReason to be included in revocation request (RR); values: C<0>..C<10>
418 or C<-1> for none (which is the default).
420 Reason numbers defined in RFC 5280 are:
422 CRLReason ::= ENUMERATED {
426 affiliationChanged (3),
428 cessationOfOperation (5),
430 -- value 7 is not used
432 privilegeWithdrawn (9),
438 =head2 Message transfer options
442 =item B<-server> I<[http[s]://][userinfo@]host[:port][/path][?query][#fragment]>
444 The IP address or DNS hostname and optionally port (defaulting to 80 or 443)
445 of the CMP server to connect to using HTTP(S) transport.
446 The scheme I<https> may be given only if the B<tls_used> option is used.
447 The optional userinfo and fragment components are ignored.
448 Any given query component is handled as part of the path component.
449 If a path is included it provides the default value for the B<-path> option.
451 =item B<-path> I<remote_path>
453 HTTP path at the CMP server (aka CMP alias) to use for POST requests.
454 Defaults to any path given with B<-server>, else C<"/">.
456 =item B<-proxy> I<[http[s]://][userinfo@]host[:port] [/path][?query][#fragment]>
458 The HTTP(S) proxy server to use for reaching the CMP server unless B<no_proxy>
460 The optional I<http://> or I<https://> prefix is ignored (note that TLS may be
461 selected by B<tls_used>), as well as any path, userinfo, and query, and fragment
463 Defaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY>
464 in case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>.
466 =item B<-no_proxy> I<addresses>
468 List of IP addresses and/or DNS names of servers
469 not to use an HTTP(S) proxy for, separated by commas and/or whitespace
470 (where in the latter case the whole argument must be enclosed in "...").
471 Default is from the environment variable C<no_proxy> if set, else C<NO_PROXY>.
473 =item B<-recipient> I<name>
475 Distinguished Name (DN) to use in the recipient field of CMP request message
476 headers, i.e., the CMP server (usually the addressed CA).
478 The recipient field in the header of a CMP message is mandatory.
479 If not given explicitly the recipient is determined in the following order:
480 the subject of the CMP server certificate given with the B<-srvcert> option,
481 the B<-issuer> option,
482 the issuer of the certificate given with the B<-oldcert> option,
483 the issuer of the CMP client certificate (B<-cert> option),
484 as far as any of those is present, else the NULL-DN as last resort.
486 The argument must be formatted as I</type0=value0/type1=value1/type2=...>.
487 For details see the description of the B<-subject> option.
489 =item B<-msg_timeout> I<seconds>
491 Number of seconds (or 0 for infinite) a CMP request-response message round trip
492 is allowed to take before a timeout error is returned.
495 =item B<-total_timeout> I<seconds>
497 Maximum number seconds an overall enrollment transaction may take,
498 including attempts polling for certificates on C<waiting> PKIStatus.
499 Default is 0 (infinite).
503 =head2 Server authentication options
507 =item B<-trusted> I<filenames>|I<uris>
509 When validating signature-based protection of CMP response messages,
510 these are the CA certificate(s) to trust while checking certificate chains
511 during CMP server authentication.
512 This option gives more flexibility than the B<-srvcert> option because the
513 server-side CMP signer certificate is not pinned but may be any certificate
514 for which a chain to one of the given trusted certificates can be constructed.
516 If no B<-trusted>, B<-srvcert>, and B<-secret> option is given
517 then protected response messages from the server are not authenticated.
519 Multiple sources may be given, separated by commas and/or whitespace
520 (where in the latter case the whole argument must be enclosed in "...").
521 Each source may contain multiple certificates.
523 The certificate verification options
524 B<-verify_hostname>, B<-verify_ip>, and B<-verify_email>
525 have no effect on the certificate verification enabled via this option.
527 =item B<-untrusted> I<filenames>|I<uris>
529 Non-trusted intermediate CA certificate(s).
530 Any extra certificates given with the B<-cert> option are appended to it.
531 All these certificates may be useful for cert path construction
532 for the CMP client certificate (to include in the extraCerts field of outgoing
533 messages) and for the TLS client certificate (if TLS is enabled)
534 as well as for chain building
535 when validating the CMP server certificate (checking signature-based
536 CMP message protection) and when validating newly enrolled certificates.
538 Multiple sources may be given, separated by commas and/or whitespace.
539 Each file may contain multiple certificates.
541 =item B<-srvcert> I<filename>|I<uri>
543 The specific CMP server certificate to expect and directly trust (even if it is
544 expired) when validating signature-based protection of CMP response messages.
545 May be set alternatively to the B<-trusted> option to pin the accepted server.
547 If set, the subject of the certificate is also used
548 as default value for the recipient of CMP requests
549 and as default value for the expected sender of incoming CMP messages.
551 =item B<-expect_sender> I<name>
553 Distinguished Name (DN) expected in the sender field of incoming CMP messages.
554 Defaults to the subject DN of the pinned B<-srvcert>, if any.
556 This can be used to make sure that only a particular entity is accepted as
557 CMP message signer, and attackers are not able to use arbitrary certificates
558 of a trusted PKI hierarchy to fraudulently pose as a CMP server.
559 Note that this option gives slightly more freedom than setting the B<-srvcert>,
560 which pins the server to the holder of a particular certificate, while the
561 expected sender name will continue to match after updates of the server cert.
563 The argument must be formatted as I</type0=value0/type1=value1/type2=...>.
564 For details see the description of the B<-subject> option.
566 =item B<-ignore_keyusage>
568 Ignore key usage restrictions in CMP signer certificates when validating
569 signature-based protection of incoming CMP messages,
570 else C<digitalSignature> must be allowed for signer certificate.
572 =item B<-unprotected_errors>
574 Accept missing or invalid protection of negative responses from the server.
575 This applies to the following message types and contents:
579 =item * error messages
581 =item * negative certificate responses (IP/CP/KUP)
583 =item * negative revocation responses (RP)
585 =item * negative PKIConf messages
589 B<WARNING:> This setting leads to unspecified behavior and it is meant
590 exclusively to allow interoperability with server implementations violating
595 =item * section 5.1.3.1 allows exceptions from protecting only for special
597 "There MAY be cases in which the PKIProtection BIT STRING is deliberately not
598 used to protect a message [...] because other protection, external to PKIX, will
601 =item * section 5.3.21 is clear on ErrMsgContent: "The CA MUST always sign it
602 with a signature key."
604 =item * appendix D.4 shows PKIConf message having protection
608 =item B<-extracertsout> I<filename>
610 The file where to save all certificates contained in the extraCerts field
611 of the last received response message (except for pollRep and PKIConf).
613 =item B<-cacertsout> I<filename>
615 The file where to save any CA certificates contained in the caPubs field of
616 the last received certificate response (i.e., IP, CP, or KUP) message.
620 =head2 Client authentication options
624 =item B<-ref> I<value>
626 Reference number/string/value to use as fallback senderKID; this is required
627 if no sender name can be determined from the B<-cert> or <-subject> options and
628 is typically used when authenticating with pre-shared key (password-based MAC).
630 =item B<-secret> I<arg>
632 Prefer PBM-based message protection with given source of a secret value.
633 The secret is used for creating PBM-based protection of outgoing messages
634 and (as far as needed) for validating PBM-based protection of incoming messages.
635 PBM stands for Password-Based Message Authentication Code.
636 This takes precedence over the B<-cert> and B<-key> options.
638 For more information about the format of B<arg> see
639 L<openssl-passphrase-options(1)>.
641 =item B<-cert> I<filename>|I<uri>
643 The client's current CMP signer certificate.
644 Requires the corresponding key to be given with B<-key>.
645 The subject of this certificate will be used as sender of outgoing CMP messages,
646 while the subject of B<-oldcert> or B<-subjectName> may provide fallback values.
647 The issuer of this certificate is used as one of the recipient fallback values
648 and as fallback issuer entry in the certificate template of IR/CR/KUR.
649 When using signature-based message protection, this "protection certificate"
650 will be included first in the extraCerts field of outgoing messages
651 and the signature is done with the corresponding key.
652 In Initialization Request (IR) messages this can be used for authenticating
653 using an external entity certificate as defined in appendix E.7 of RFC 4210.
654 For Key Update Request (KUR) messages this is also used as
655 the certificate to be updated if the B<-oldcert> option is not given.
656 If the file includes further certs, they are appended to the untrusted certs
657 because they typically constitute the chain of the client certificate, which
658 is included in the extraCerts field in signature-protected request messages.
660 =item B<-own_trusted> I<filenames>|I<uris>
662 If this list of certificates is provided then the chain built for
663 the client-side CMP signer certificate given with the B<-cert> option
664 is verified using the given certificates as trust anchors.
666 Multiple sources may be given, separated by commas and/or whitespace
667 (where in the latter case the whole argument must be enclosed in "...").
668 Each source may contain multiple certificates.
670 The certificate verification options
671 B<-verify_hostname>, B<-verify_ip>, and B<-verify_email>
672 have no effect on the certificate verification enabled via this option.
674 =item B<-key> I<filename>|I<uri>
676 The corresponding private key file for the client's current certificate given in
678 This will be used for signature-based message protection unless
679 the B<-secret> option indicating PBM or B<-unprotected_requests> is given.
681 =item B<-keypass> I<arg>
683 Pass phrase source for the private key given with the B<-key> option.
684 Also used for B<-cert> and B<-oldcert> in case it is an encrypted PKCS#12 file.
685 If not given here, the password will be prompted for if needed.
687 For more information about the format of B<arg> see
688 L<openssl-passphrase-options(1)>.
690 =item B<-digest> I<name>
692 Specifies name of supported digest to use in RFC 4210's MSG_SIG_ALG
693 and as the one-way function (OWF) in MSG_MAC_ALG.
694 If applicable, this is used for message protection and
695 Proof-of-Possession (POPO) signatures.
696 To see the list of supported digests, use B<openssl list -digest-commands>.
697 Defaults to C<sha256>.
699 =item B<-mac> I<name>
701 Specifies the name of the MAC algorithm in MSG_MAC_ALG.
702 To get the names of supported MAC algorithms use B<openssl list -mac-algorithms>
703 and possibly combine such a name with the name of a supported digest algorithm,
704 e.g., hmacWithSHA256.
705 Defaults to C<hmac-sha1> as per RFC 4210.
707 =item B<-extracerts> I<filenames>|I<uris>
709 Certificates to append in the extraCerts field when sending messages.
710 They can be used as the default CMP signer certificate chain to include.
712 Multiple sources may be given, separated by commas and/or whitespace
713 (where in the latter case the whole argument must be enclosed in "...").
714 Each source may contain multiple certificates.
716 =item B<-unprotected_requests>
718 Send messages without CMP-level protection.
722 =head2 Credentials format options
726 =item B<-certform> I<PEM|DER>
728 File format to use when saving a certificate to a file.
729 Default value is PEM.
731 =item B<-keyform> I<PEM|DER|P12|ENGINE>
733 The format of the key input.
734 The only value with effect is B<ENGINE>.
735 See L<openssl(1)/Format Options> for details.
737 =item B<-otherpass> I<arg>
739 Pass phrase source for certificate given with the B<-trusted>, B<-untrusted>,
740 B<-own_trusted>, B<-srvcert>, B<-out_trusted>, B<-extracerts>,
741 B<-srv_trusted>, B<-srv_untrusted>, B<-rsp_extracerts>, B<-rsp_capubs>,
742 B<-tls_extra>, and B<-tls_trusted> options.
743 If not given here, the password will be prompted for if needed.
745 For more information about the format of B<arg> see
746 L<openssl-passphrase-options(1)>.
748 {- $OpenSSL::safe::opt_engine_item -}
750 {- output_off() if $disabled{"deprecated-3.0"}; "" -}
751 As an alternative to using this combination:
753 -engine {engineid} -key {keyid} -keyform ENGINE
755 ... it's also possible to just give the key ID in URI form to B<-key>,
758 -key org.openssl.engine:{engineid}:{keyid}
760 This applies to all options specifying keys: B<-key>, B<-newkey>, and
762 {- output_on() if $disabled{"deprecated-3.0"}; "" -}
766 =head2 Provider options
770 {- $OpenSSL::safe::opt_provider_item -}
774 =head2 Random state options
778 {- $OpenSSL::safe::opt_r_item -}
782 =head2 TLS connection options
788 Enable using TLS (even when other TLS_related options are not set)
789 when connecting to CMP server.
791 =item B<-tls_cert> I<filename>|I<uri>
793 Client's TLS certificate.
794 If the source includes further certs they are used (along with B<-untrusted>
795 certs) for constructing the client cert chain provided to the TLS server.
797 =item B<-tls_key> I<filename>|I<uri>
799 Private key for the client's TLS certificate.
801 =item B<-tls_keypass> I<arg>
803 Pass phrase source for client's private TLS key B<tls_key>.
804 Also used for B<-tls_cert> in case it is an encrypted PKCS#12 file.
805 If not given here, the password will be prompted for if needed.
807 For more information about the format of B<arg> see
808 L<openssl-passphrase-options(1)>.
810 =item B<-tls_extra> I<filenames>|I<uris>
812 Extra certificates to provide to TLS server during TLS handshake
814 =item B<-tls_trusted> I<filenames>|I<uris>
816 Trusted certificate(s) to use for validating the TLS server certificate.
817 This implies hostname validation.
819 Multiple sources may be given, separated by commas and/or whitespace
820 (where in the latter case the whole argument must be enclosed in "...").
821 Each source may contain multiple certificates.
823 The certificate verification options
824 B<-verify_hostname>, B<-verify_ip>, and B<-verify_email>
825 have no effect on the certificate verification enabled via this option.
827 =item B<-tls_host> I<name>
829 Address to be checked during hostname validation.
830 This may be a DNS name or an IP address.
831 If not given it defaults to the B<-server> address.
835 =head2 Client-side debugging options
841 Do not interactively prompt for input, for instance when a password is needed.
842 This can be useful for batch processing and testing.
844 =item B<-repeat> I<number>
846 Invoke the command the given positive number of times with the same parameters.
847 Default is one invocation.
849 =item B<-reqin> I<filenames>
851 Take sequence of CMP requests from file(s).
853 Multiple filenames may be given, separated by commas and/or whitespace
854 (where in the latter case the whole argument must be enclosed in "...").
855 As many files are read as needed for a complete transaction.
857 =item B<-reqin_new_tid>
859 Use a fresh transactionID for CMP request messages read using B<-reqin>,
860 which requires re-protecting them as far as they were protected before.
861 This may be needed in case the sequence of requests is reused
862 and the CMP server complains that the transaction ID has already been used.
864 =item B<-reqout> I<filenames>
866 Save sequence of CMP requests to file(s).
868 Multiple filenames may be given, separated by commas and/or whitespace.
869 As many files are written as needed to store the complete transaction.
871 =item B<-rspin> I<filenames>
873 Process sequence of CMP responses provided in file(s), skipping server.
875 Multiple filenames may be given, separated by commas and/or whitespace.
876 As many files are read as needed for the complete transaction.
878 =item B<-rspout> I<filenames>
880 Save sequence of CMP responses to file(s).
882 Multiple filenames may be given, separated by commas and/or whitespace.
883 As many files are written as needed to store the complete transaction.
885 =item B<-use_mock_srv>
887 Use the internal mock server for testing the client.
888 This works at API level, bypassing HTTP transport.
892 =head2 Mock server options
896 =item B<-port> I<number>
898 Act as CMP HTTP server mock-up listening on the given port.
900 =item B<-max_msgs> I<number>
902 Maximum number of CMP (request) messages the CMP HTTP server mock-up
903 should handle, which must be nonnegative.
904 The default value is 0, which means that no limit is imposed.
905 In any case the server terminates on internal errors, but not when it
906 detects a CMP-level error that it can successfully answer with an error message.
908 =item B<-srv_ref> I<value>
910 Reference value to use as senderKID of server in case no B<-srv_cert> is given.
912 =item B<-srv_secret> I<arg>
914 Password source for server authentication with a pre-shared key (secret).
916 =item B<-srv_cert> I<filename>|I<uri>
918 Certificate of the server.
920 =item B<-srv_key> I<filename>|I<uri>
922 Private key used by the server for signing messages.
924 =item B<-srv_keypass> I<arg>
926 Server private key (and cert) file pass phrase source.
928 =item B<-srv_trusted> I<filenames>|I<uris>
930 Trusted certificates for client authentication.
932 The certificate verification options
933 B<-verify_hostname>, B<-verify_ip>, and B<-verify_email>
934 have no effect on the certificate verification enabled via this option.
936 =item B<-srv_untrusted> I<filenames>|I<uris>
938 Intermediate CA certs that may be useful when validating client certificates.
940 =item B<-rsp_cert> I<filename>|I<uri>
942 Certificate to be returned as mock enrollment result.
944 =item B<-rsp_extracerts> I<filenames>|I<uris>
946 Extra certificates to be included in mock certification responses.
948 =item B<-rsp_capubs> I<filenames>|I<uris>
950 CA certificates to be included in mock Initialization Response (IP) message.
952 =item B<-poll_count> I<number>
954 Number of times the client must poll before receiving a certificate.
956 =item B<-check_after> I<number>
958 The checkAfter value (number of seconds to wait) to include in poll response.
960 =item B<-grant_implicitconf>
962 Grant implicit confirmation of newly enrolled certificate.
964 =item B<-pkistatus> I<number>
966 PKIStatus to be included in server response.
967 Valid range is 0 (accepted) .. 6 (keyUpdateWarning).
969 =item B<-failure> I<number>
971 A single failure info bit number to be included in server response.
972 Valid range is 0 (badAlg) .. 26 (duplicateCertReq).
974 =item B<-failurebits> I<number>
975 Number representing failure bits to be included in server response.
976 Valid range is 0 .. 2^27 - 1.
978 =item B<-statusstring> I<arg>
980 Text to be included as status string in server response.
984 Force server to reply with error message.
986 =item B<-send_unprotected>
988 Send response messages without CMP-level protection.
990 =item B<-send_unprot_err>
992 In case of negative responses, server shall send unprotected error messages,
993 certificate responses (IP/CP/KUP), and revocation responses (RP).
994 WARNING: This setting leads to behavior violating RFC 4210.
996 =item B<-accept_unprotected>
998 Accept missing or invalid protection of requests.
1000 =item B<-accept_unprot_err>
1002 Accept unprotected error messages from client.
1004 =item B<-accept_raverified>
1006 Accept RAVERIFED as proof-of-possession (POPO).
1010 =head2 Certificate verification options, for both CMP and TLS
1014 {- $OpenSSL::safe::opt_v_item -}
1016 The certificate verification options
1017 B<-verify_hostname>, B<-verify_ip>, and B<-verify_email>
1018 only affect the certificate verification enabled via the B<-out_trusted> option.
1024 When setting up CMP configurations and experimenting with enrollment options
1025 typically various errors occur until the configuration is correct and complete.
1026 When the CMP server reports an error the client will by default
1027 check the protection of the CMP response message.
1028 Yet some CMP services tend not to protect negative responses.
1029 In this case the client will reject them, and thus their contents are not shown
1030 although they usually contain hints that would be helpful for diagnostics.
1031 For assisting in such cases the CMP client offers a workaround via the
1032 B<-unprotected_errors> option, which allows accepting such negative messages.
1036 =head2 Simple examples using the default OpenSSL configuration file
1038 This CMP client implementation comes with demonstrative CMP sections
1039 in the example configuration file F<openssl/apps/openssl.cnf>,
1040 which can be used to interact conveniently with the Insta Demo CA.
1042 In order to enroll an initial certificate from that CA it is sufficient
1043 to issue the following shell commands.
1045 export OPENSSL_CONF=/path/to/openssl/apps/openssl.cnf
1049 wget 'http://pki.certificate.fi:8081/install-ca-cert.html/ca-certificate.crt\
1050 ?ca-id=632&download-certificate=1' -O insta.ca.crt
1054 openssl genrsa -out insta.priv.pem
1055 openssl cmp -section insta
1057 This should produce the file F<insta.cert.pem> containing a new certificate
1058 for the private key held in F<insta.priv.pem>.
1059 It can be viewed using, e.g.,
1061 openssl x509 -noout -text -in insta.cert.pem
1063 In case the network setup requires using an HTTP proxy it may be given as usual
1064 via the environment variable B<http_proxy> or via the B<proxy> option in the
1065 configuration file or the CMP command-line argument B<-proxy>, for example
1067 -proxy http://192.168.1.1:8080
1069 In the Insta Demo CA scenario both clients and the server may use the pre-shared
1070 secret I<insta> and the reference value I<3078> to authenticate to each other.
1072 Alternatively, CMP messages may be protected in signature-based manner,
1073 where the trust anchor in this case is F<insta.ca.crt>
1074 and the client may use any certificate already obtained from that CA,
1075 as specified in the B<[signature]> section of the example configuration.
1076 This can be used in combination with the B<[insta]> section simply by
1078 openssl cmp -section insta,signature
1080 By default the CMP IR message type is used, yet CR works equally here.
1081 This may be specified directly at the command line:
1083 openssl cmp -section insta -cmd cr
1085 or by referencing in addition the B<[cr]> section of the example configuration:
1087 openssl cmp -section insta,cr
1089 In order to update the enrolled certificate one may call
1091 openssl cmp -section insta,kur
1093 using with PBM-based protection or
1095 openssl cmp -section insta,kur,signature
1097 using signature-based protection.
1099 In a similar way any previously enrolled certificate may be revoked by
1101 openssl cmp -section insta,rr -trusted insta.ca.crt
1105 openssl cmp -section insta,rr,signature
1107 Many more options can be given in the configuration file
1108 and/or on the command line.
1109 For instance, the B<-reqexts> CLI option may refer to a section in the
1110 configuration file defining X.509 extensions to use in certificate requests,
1111 such as B<v3_req> in F<openssl/apps/openssl.cnf>:
1113 openssl cmp -section insta,cr -reqexts v3_req
1115 =head2 Certificate enrollment
1117 The following examples do not make use of a configuration file at first.
1118 They assume that a CMP server can be contacted on the local TCP port 80
1119 and accepts requests under the alias I</pkix/>.
1121 For enrolling its very first certificate the client generates a client key
1122 and sends an initial request message to the local CMP server
1123 using a pre-shared secret key for mutual authentication.
1124 In this example the client does not have the CA certificate yet,
1125 so we specify the name of the CA with the B<-recipient> option
1126 and save any CA certificates that we may receive in the C<capubs.pem> file.
1128 In below command line usage examples the C<\> at line ends is used just
1129 for formatting; each of the command invocations should be on a single line.
1131 openssl genrsa -out cl_key.pem
1132 openssl cmp -cmd ir -server 127.0.0.1:80/pkix/ -recipient "/CN=CMPserver" \
1133 -ref 1234 -secret pass:1234-5678 \
1134 -newkey cl_key.pem -subject "/CN=MyName" \
1135 -cacertsout capubs.pem -certout cl_cert.pem
1137 =head2 Certificate update
1139 Then, when the client certificate and its related key pair needs to be updated,
1140 the client can send a key update request taking the certs in C<capubs.pem>
1141 as trusted for authenticating the server and using the previous cert and key
1142 for its own authentication.
1143 Then it can start using the new cert and key.
1145 openssl genrsa -out cl_key_new.pem
1146 openssl cmp -cmd kur -server 127.0.0.1:80/pkix/ \
1147 -trusted capubs.pem \
1148 -cert cl_cert.pem -key cl_key.pem \
1149 -newkey cl_key_new.pem -certout cl_cert.pem
1150 cp cl_key_new.pem cl_key.pem
1152 This command sequence can be repated as often as needed.
1154 =head2 Requesting information from CMP server
1156 Requesting "all relevant information" with an empty General Message.
1157 This prints information about all received ITAV B<infoType>s to stdout.
1159 openssl cmp -cmd genm -server 127.0.0.1/pkix/ -recipient "/CN=CMPserver" \
1160 -ref 1234 -secret pass:1234-5678
1162 =head2 Using a custom configuration file
1164 For CMP client invocations, in particular for certificate enrollment,
1165 usually many parameters need to be set, which is tedious and error-prone to do
1166 on the command line.
1167 Therefore, the client offers the possibility to read
1168 options from sections of the OpenSSL config file, usually called B<openssl.cnf>.
1169 The values found there can still be extended and even overridden by any
1170 subsequently loaded sections and on the command line.
1172 After including in the configuration file the following sections:
1177 trusted = capubs.pem
1181 certout = cl_cert.pem
1184 recipient = "/CN=CMPserver"
1189 secret = pass:1234-5678-1234-567
1190 subject = "/CN=MyName"
1191 cacertsout = capubs.pem
1193 the above enrollment transactions reduce to
1195 openssl cmp -section cmp,init
1196 openssl cmp -cmd kur -newkey cl_key_new.pem
1198 and the above transaction using a general message reduces to
1200 openssl cmp -section cmp,init -cmd genm
1204 L<openssl-genrsa(1)>, L<openssl-ecparam(1)>, L<openssl-list(1)>,
1205 L<openssl-req(1)>, L<openssl-x509(1)>, L<x509v3_config(5)>
1209 The B<cmp> application was added in OpenSSL 3.0.
1211 The B<-engine option> was deprecated in OpenSSL 3.0.
1215 Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
1217 Licensed under the OpenSSL license (the "License"). You may not use
1218 this file except in compliance with the License. You can obtain a copy
1219 in the file LICENSE in the source distribution or at
1220 L<https://www.openssl.org/source/license.html>.