openssl-cmp.pod.in 50 KB

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