openssl-ca.1ossl 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926
  1. .\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42)
  2. .\"
  3. .\" Standard preamble:
  4. .\" ========================================================================
  5. .de Sp \" Vertical space (when we can't use .PP)
  6. .if t .sp .5v
  7. .if n .sp
  8. ..
  9. .de Vb \" Begin verbatim text
  10. .ft CW
  11. .nf
  12. .ne \\$1
  13. ..
  14. .de Ve \" End verbatim text
  15. .ft R
  16. .fi
  17. ..
  18. .\" Set up some character translations and predefined strings. \*(-- will
  19. .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
  20. .\" double quote, and \*(R" will give a right double quote. \*(C+ will
  21. .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
  22. .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
  23. .\" nothing in troff, for use with C<>.
  24. .tr \(*W-
  25. .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
  26. .ie n \{\
  27. . ds -- \(*W-
  28. . ds PI pi
  29. . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  30. . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  31. . ds L" ""
  32. . ds R" ""
  33. . ds C` ""
  34. . ds C' ""
  35. 'br\}
  36. .el\{\
  37. . ds -- \|\(em\|
  38. . ds PI \(*p
  39. . ds L" ``
  40. . ds R" ''
  41. . ds C`
  42. . ds C'
  43. 'br\}
  44. .\"
  45. .\" Escape single quotes in literal strings from groff's Unicode transform.
  46. .ie \n(.g .ds Aq \(aq
  47. .el .ds Aq '
  48. .\"
  49. .\" If the F register is >0, we'll generate index entries on stderr for
  50. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  51. .\" entries marked with X<> in POD. Of course, you'll have to process the
  52. .\" output yourself in some meaningful fashion.
  53. .\"
  54. .\" Avoid warning from groff about undefined register 'F'.
  55. .de IX
  56. ..
  57. .nr rF 0
  58. .if \n(.g .if rF .nr rF 1
  59. .if (\n(rF:(\n(.g==0)) \{\
  60. . if \nF \{\
  61. . de IX
  62. . tm Index:\\$1\t\\n%\t"\\$2"
  63. ..
  64. . if !\nF==2 \{\
  65. . nr % 0
  66. . nr F 2
  67. . \}
  68. . \}
  69. .\}
  70. .rr rF
  71. .\"
  72. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  73. .\" Fear. Run. Save yourself. No user-serviceable parts.
  74. . \" fudge factors for nroff and troff
  75. .if n \{\
  76. . ds #H 0
  77. . ds #V .8m
  78. . ds #F .3m
  79. . ds #[ \f1
  80. . ds #] \fP
  81. .\}
  82. .if t \{\
  83. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  84. . ds #V .6m
  85. . ds #F 0
  86. . ds #[ \&
  87. . ds #] \&
  88. .\}
  89. . \" simple accents for nroff and troff
  90. .if n \{\
  91. . ds ' \&
  92. . ds ` \&
  93. . ds ^ \&
  94. . ds , \&
  95. . ds ~ ~
  96. . ds /
  97. .\}
  98. .if t \{\
  99. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  100. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  101. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  102. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  103. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  104. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  105. .\}
  106. . \" troff and (daisy-wheel) nroff accents
  107. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  108. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  109. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  110. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  111. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  112. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  113. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  114. .ds ae a\h'-(\w'a'u*4/10)'e
  115. .ds Ae A\h'-(\w'A'u*4/10)'E
  116. . \" corrections for vroff
  117. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  118. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  119. . \" for low resolution devices (crt and lpr)
  120. .if \n(.H>23 .if \n(.V>19 \
  121. \{\
  122. . ds : e
  123. . ds 8 ss
  124. . ds o a
  125. . ds d- d\h'-1'\(ga
  126. . ds D- D\h'-1'\(hy
  127. . ds th \o'bp'
  128. . ds Th \o'LP'
  129. . ds ae ae
  130. . ds Ae AE
  131. .\}
  132. .rm #[ #] #H #V #F C
  133. .\" ========================================================================
  134. .\"
  135. .IX Title "OPENSSL-CA 1ossl"
  136. .TH OPENSSL-CA 1ossl "2025-06-29" "3.3.2" "OpenSSL"
  137. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  138. .\" way too many mistakes in technical documents.
  139. .if n .ad l
  140. .nh
  141. .SH "NAME"
  142. openssl\-ca \- sample minimal CA application
  143. .SH "SYNOPSIS"
  144. .IX Header "SYNOPSIS"
  145. \&\fBopenssl\fR \fBca\fR
  146. [\fB\-help\fR]
  147. [\fB\-verbose\fR]
  148. [\fB\-quiet\fR]
  149. [\fB\-config\fR \fIfilename\fR]
  150. [\fB\-name\fR \fIsection\fR]
  151. [\fB\-section\fR \fIsection\fR]
  152. [\fB\-gencrl\fR]
  153. [\fB\-revoke\fR \fIfile\fR]
  154. [\fB\-valid\fR \fIfile\fR]
  155. [\fB\-status\fR \fIserial\fR]
  156. [\fB\-updatedb\fR]
  157. [\fB\-crl_reason\fR \fIreason\fR]
  158. [\fB\-crl_hold\fR \fIinstruction\fR]
  159. [\fB\-crl_compromise\fR \fItime\fR]
  160. [\fB\-crl_CA_compromise\fR \fItime\fR]
  161. [\fB\-crl_lastupdate\fR \fIdate\fR]
  162. [\fB\-crl_nextupdate\fR \fIdate\fR]
  163. [\fB\-crldays\fR \fIdays\fR]
  164. [\fB\-crlhours\fR \fIhours\fR]
  165. [\fB\-crlsec\fR \fIseconds\fR]
  166. [\fB\-crlexts\fR \fIsection\fR]
  167. [\fB\-startdate\fR \fIdate\fR]
  168. [\fB\-enddate\fR \fIdate\fR]
  169. [\fB\-days\fR \fIarg\fR]
  170. [\fB\-md\fR \fIarg\fR]
  171. [\fB\-policy\fR \fIarg\fR]
  172. [\fB\-keyfile\fR \fIfilename\fR|\fIuri\fR]
  173. [\fB\-keyform\fR \fB\s-1DER\s0\fR|\fB\s-1PEM\s0\fR|\fBP12\fR|\fB\s-1ENGINE\s0\fR]
  174. [\fB\-key\fR \fIarg\fR]
  175. [\fB\-passin\fR \fIarg\fR]
  176. [\fB\-cert\fR \fIfile\fR]
  177. [\fB\-certform\fR \fB\s-1DER\s0\fR|\fB\s-1PEM\s0\fR|\fBP12\fR]
  178. [\fB\-selfsign\fR]
  179. [\fB\-in\fR \fIfile\fR]
  180. [\fB\-inform\fR \fB\s-1DER\s0\fR|<\s-1PEM\s0>]
  181. [\fB\-out\fR \fIfile\fR]
  182. [\fB\-notext\fR]
  183. [\fB\-dateopt\fR]
  184. [\fB\-outdir\fR \fIdir\fR]
  185. [\fB\-infiles\fR]
  186. [\fB\-spkac\fR \fIfile\fR]
  187. [\fB\-ss_cert\fR \fIfile\fR]
  188. [\fB\-preserveDN\fR]
  189. [\fB\-noemailDN\fR]
  190. [\fB\-batch\fR]
  191. [\fB\-msie_hack\fR]
  192. [\fB\-extensions\fR \fIsection\fR]
  193. [\fB\-extfile\fR \fIsection\fR]
  194. [\fB\-subj\fR \fIarg\fR]
  195. [\fB\-utf8\fR]
  196. [\fB\-sigopt\fR \fInm\fR:\fIv\fR]
  197. [\fB\-vfyopt\fR \fInm\fR:\fIv\fR]
  198. [\fB\-create_serial\fR]
  199. [\fB\-rand_serial\fR]
  200. [\fB\-multivalue\-rdn\fR]
  201. [\fB\-rand\fR \fIfiles\fR]
  202. [\fB\-writerand\fR \fIfile\fR]
  203. [\fB\-engine\fR \fIid\fR]
  204. [\fB\-provider\fR \fIname\fR]
  205. [\fB\-provider\-path\fR \fIpath\fR]
  206. [\fB\-propquery\fR \fIpropq\fR]
  207. [\fIcertreq\fR...]
  208. .SH "DESCRIPTION"
  209. .IX Header "DESCRIPTION"
  210. This command emulates a \s-1CA\s0 application.
  211. See the \fB\s-1WARNINGS\s0\fR especially when considering to use it productively.
  212. .PP
  213. It generates certificates bearing X.509 version 3.
  214. Unless specified otherwise,
  215. key identifier extensions are included as described in \fBx509v3_config\fR\|(5).
  216. .PP
  217. It can be used to sign certificate requests (CSRs) in a variety of forms
  218. and generate certificate revocation lists (CRLs).
  219. It also maintains a text database of issued certificates and their status.
  220. When signing certificates, a single request can be specified
  221. with the \fB\-in\fR option, or multiple requests can be processed by
  222. specifying a set of \fBcertreq\fR files after all options.
  223. .PP
  224. Note that there are also very lean ways of generating certificates:
  225. the \fBreq\fR and \fBx509\fR commands can be used for directly creating certificates.
  226. See \fBopenssl\-req\fR\|(1) and \fBopenssl\-x509\fR\|(1) for details.
  227. .PP
  228. The descriptions of the \fBca\fR command options are divided into each purpose.
  229. .SH "OPTIONS"
  230. .IX Header "OPTIONS"
  231. .IP "\fB\-help\fR" 4
  232. .IX Item "-help"
  233. Print out a usage message.
  234. .IP "\fB\-verbose\fR" 4
  235. .IX Item "-verbose"
  236. This prints extra details about the operations being performed.
  237. .IP "\fB\-quiet\fR" 4
  238. .IX Item "-quiet"
  239. This prints fewer details about the operations being performed, which may
  240. be handy during batch scripts or pipelines.
  241. .IP "\fB\-config\fR \fIfilename\fR" 4
  242. .IX Item "-config filename"
  243. Specifies the configuration file to use.
  244. Optional; for a description of the default value,
  245. see \*(L"\s-1COMMAND SUMMARY\*(R"\s0 in \fBopenssl\fR\|(1).
  246. .IP "\fB\-name\fR \fIsection\fR, \fB\-section\fR \fIsection\fR" 4
  247. .IX Item "-name section, -section section"
  248. Specifies the configuration file section to use (overrides
  249. \&\fBdefault_ca\fR in the \fBca\fR section).
  250. .IP "\fB\-in\fR \fIfilename\fR" 4
  251. .IX Item "-in filename"
  252. An input filename containing a single certificate request (\s-1CSR\s0) to be
  253. signed by the \s-1CA.\s0
  254. .IP "\fB\-inform\fR \fB\s-1DER\s0\fR|\fB\s-1PEM\s0\fR" 4
  255. .IX Item "-inform DER|PEM"
  256. The format to use when loading certificate request (\s-1CSR\s0) input files;
  257. by default \s-1PEM\s0 is tried first.
  258. See \fBopenssl\-format\-options\fR\|(1) for details.
  259. .IP "\fB\-ss_cert\fR \fIfilename\fR" 4
  260. .IX Item "-ss_cert filename"
  261. A single self-signed certificate to be signed by the \s-1CA.\s0
  262. .IP "\fB\-spkac\fR \fIfilename\fR" 4
  263. .IX Item "-spkac filename"
  264. A file containing a single Netscape signed public key and challenge
  265. and additional field values to be signed by the \s-1CA.\s0 See the \fB\s-1SPKAC FORMAT\s0\fR
  266. section for information on the required input and output format.
  267. .IP "\fB\-infiles\fR" 4
  268. .IX Item "-infiles"
  269. If present this should be the last option, all subsequent arguments
  270. are taken as the names of files containing certificate requests.
  271. .IP "\fB\-out\fR \fIfilename\fR" 4
  272. .IX Item "-out filename"
  273. The output file to output certificates to. The default is standard
  274. output. The certificate details will also be printed out to this
  275. file in \s-1PEM\s0 format (except that \fB\-spkac\fR outputs \s-1DER\s0 format).
  276. .IP "\fB\-outdir\fR \fIdirectory\fR" 4
  277. .IX Item "-outdir directory"
  278. The directory to output certificates to. The certificate will be
  279. written to a filename consisting of the serial number in hex with
  280. \&\fI.pem\fR appended.
  281. .IP "\fB\-cert\fR \fIfilename\fR" 4
  282. .IX Item "-cert filename"
  283. The \s-1CA\s0 certificate, which must match with \fB\-keyfile\fR.
  284. .IP "\fB\-certform\fR \fB\s-1DER\s0\fR|\fB\s-1PEM\s0\fR|\fBP12\fR" 4
  285. .IX Item "-certform DER|PEM|P12"
  286. The format of the data in certificate input files; unspecified by default.
  287. See \fBopenssl\-format\-options\fR\|(1) for details.
  288. .IP "\fB\-keyfile\fR \fIfilename\fR|\fIuri\fR" 4
  289. .IX Item "-keyfile filename|uri"
  290. The \s-1CA\s0 private key to sign certificate requests with.
  291. This must match with \fB\-cert\fR.
  292. .IP "\fB\-keyform\fR \fB\s-1DER\s0\fR|\fB\s-1PEM\s0\fR|\fBP12\fR|\fB\s-1ENGINE\s0\fR" 4
  293. .IX Item "-keyform DER|PEM|P12|ENGINE"
  294. The format of the private key input file; unspecified by default.
  295. See \fBopenssl\-format\-options\fR\|(1) for details.
  296. .IP "\fB\-sigopt\fR \fInm\fR:\fIv\fR" 4
  297. .IX Item "-sigopt nm:v"
  298. Pass options to the signature algorithm during sign operations.
  299. Names and values of these options are algorithm-specific and
  300. documented in \*(L"Signature parameters\*(R" in \fBprovider\-signature\fR\|(7).
  301. .IP "\fB\-vfyopt\fR \fInm\fR:\fIv\fR" 4
  302. .IX Item "-vfyopt nm:v"
  303. Pass options to the signature algorithm during verify operations.
  304. Names and values of these options are algorithm-specific.
  305. .Sp
  306. This often needs to be given while signing too, because the self-signature of
  307. a certificate signing request (\s-1CSR\s0) is verified against the included public key,
  308. and that verification may need its own set of options.
  309. .IP "\fB\-key\fR \fIpassword\fR" 4
  310. .IX Item "-key password"
  311. The password used to encrypt the private key. Since on some
  312. systems the command line arguments are visible (e.g., when using
  313. \&\fBps\fR\|(1) on Unix),
  314. this option should be used with caution.
  315. Better use \fB\-passin\fR.
  316. .IP "\fB\-passin\fR \fIarg\fR" 4
  317. .IX Item "-passin arg"
  318. The key password source for key files and certificate PKCS#12 files.
  319. For more information about the format of \fBarg\fR
  320. see \fBopenssl\-passphrase\-options\fR\|(1).
  321. .IP "\fB\-selfsign\fR" 4
  322. .IX Item "-selfsign"
  323. Indicates the issued certificates are to be signed with the key
  324. the certificate requests were signed with (given with \fB\-keyfile\fR).
  325. Certificate requests signed with a different key are ignored.
  326. If \fB\-spkac\fR, \fB\-ss_cert\fR or \fB\-gencrl\fR are given, \fB\-selfsign\fR is ignored.
  327. .Sp
  328. A consequence of using \fB\-selfsign\fR is that the self-signed
  329. certificate appears among the entries in the certificate database
  330. (see the configuration option \fBdatabase\fR), and uses the same
  331. serial number counter as all other certificates sign with the
  332. self-signed certificate.
  333. .IP "\fB\-notext\fR" 4
  334. .IX Item "-notext"
  335. Don't output the text form of a certificate to the output file.
  336. .IP "\fB\-dateopt\fR" 4
  337. .IX Item "-dateopt"
  338. Specify the date output format. Values are: rfc_822 and iso_8601.
  339. Defaults to rfc_822.
  340. .IP "\fB\-startdate\fR \fIdate\fR" 4
  341. .IX Item "-startdate date"
  342. This allows the start date to be explicitly set. The format of the
  343. date is \s-1YYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 UTCTime structure), or
  344. \&\s-1YYYYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 GeneralizedTime structure). In
  345. both formats, seconds \s-1SS\s0 and timezone Z must be present.
  346. .IP "\fB\-enddate\fR \fIdate\fR" 4
  347. .IX Item "-enddate date"
  348. This allows the expiry date to be explicitly set. The format of the
  349. date is \s-1YYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 UTCTime structure), or
  350. \&\s-1YYYYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 GeneralizedTime structure). In
  351. both formats, seconds \s-1SS\s0 and timezone Z must be present.
  352. .IP "\fB\-days\fR \fIarg\fR" 4
  353. .IX Item "-days arg"
  354. The number of days to certify the certificate for.
  355. .IP "\fB\-md\fR \fIalg\fR" 4
  356. .IX Item "-md alg"
  357. The message digest to use.
  358. Any digest supported by the \fBopenssl\-dgst\fR\|(1) command can be used. For signing
  359. algorithms that do not support a digest (i.e. Ed25519 and Ed448) any message
  360. digest that is set is ignored. This option also applies to CRLs.
  361. .IP "\fB\-policy\fR \fIarg\fR" 4
  362. .IX Item "-policy arg"
  363. This option defines the \s-1CA\s0 \*(L"policy\*(R" to use. This is a section in
  364. the configuration file which decides which fields should be mandatory
  365. or match the \s-1CA\s0 certificate. Check out the \fB\s-1POLICY FORMAT\s0\fR section
  366. for more information.
  367. .IP "\fB\-msie_hack\fR" 4
  368. .IX Item "-msie_hack"
  369. This is a deprecated option to make this command work with very old versions
  370. of the \s-1IE\s0 certificate enrollment control \*(L"certenr3\*(R". It used UniversalStrings
  371. for almost everything. Since the old control has various security bugs
  372. its use is strongly discouraged.
  373. .IP "\fB\-preserveDN\fR" 4
  374. .IX Item "-preserveDN"
  375. Normally the \s-1DN\s0 order of a certificate is the same as the order of the
  376. fields in the relevant policy section. When this option is set the order
  377. is the same as the request. This is largely for compatibility with the
  378. older \s-1IE\s0 enrollment control which would only accept certificates if their
  379. DNs match the order of the request. This is not needed for Xenroll.
  380. .IP "\fB\-noemailDN\fR" 4
  381. .IX Item "-noemailDN"
  382. The \s-1DN\s0 of a certificate can contain the \s-1EMAIL\s0 field if present in the
  383. request \s-1DN,\s0 however, it is good policy just having the e\-mail set into
  384. the altName extension of the certificate. When this option is set the
  385. \&\s-1EMAIL\s0 field is removed from the certificate' subject and set only in
  386. the, eventually present, extensions. The \fBemail_in_dn\fR keyword can be
  387. used in the configuration file to enable this behaviour.
  388. .IP "\fB\-batch\fR" 4
  389. .IX Item "-batch"
  390. This sets the batch mode. In this mode no questions will be asked
  391. and all certificates will be certified automatically.
  392. .IP "\fB\-extensions\fR \fIsection\fR" 4
  393. .IX Item "-extensions section"
  394. The section of the configuration file containing certificate extensions
  395. to be added when a certificate is issued (defaults to \fBx509_extensions\fR
  396. unless the \fB\-extfile\fR option is used).
  397. .Sp
  398. See the \fBx509v3_config\fR\|(5) manual page for details of the
  399. extension section format.
  400. .IP "\fB\-extfile\fR \fIfile\fR" 4
  401. .IX Item "-extfile file"
  402. An additional configuration file to read certificate extensions from
  403. (using the default section unless the \fB\-extensions\fR option is also
  404. used).
  405. .IP "\fB\-subj\fR \fIarg\fR" 4
  406. .IX Item "-subj arg"
  407. Supersedes subject name given in the request.
  408. .Sp
  409. The arg must be formatted as \f(CW\*(C`/type0=value0/type1=value1/type2=...\*(C'\fR.
  410. Special characters may be escaped by \f(CW\*(C`\e\*(C'\fR (backslash), whitespace is retained.
  411. Empty values are permitted, but the corresponding type will not be included
  412. in the resulting certificate.
  413. Giving a single \f(CW\*(C`/\*(C'\fR will lead to an empty sequence of RDNs (a NULL-DN).
  414. Multi-valued RDNs can be formed by placing a \f(CW\*(C`+\*(C'\fR character instead of a \f(CW\*(C`/\*(C'\fR
  415. between the AttributeValueAssertions (AVAs) that specify the members of the set.
  416. Example:
  417. .Sp
  418. \&\f(CW\*(C`/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe\*(C'\fR
  419. .IP "\fB\-utf8\fR" 4
  420. .IX Item "-utf8"
  421. This option causes field values to be interpreted as \s-1UTF8\s0 strings, by
  422. default they are interpreted as \s-1ASCII.\s0 This means that the field
  423. values, whether prompted from a terminal or obtained from a
  424. configuration file, must be valid \s-1UTF8\s0 strings.
  425. .IP "\fB\-create_serial\fR" 4
  426. .IX Item "-create_serial"
  427. If reading serial from the text file as specified in the configuration
  428. fails, specifying this option creates a new random serial to be used as next
  429. serial number.
  430. To get random serial numbers, use the \fB\-rand_serial\fR flag instead; this
  431. should only be used for simple error-recovery.
  432. .IP "\fB\-rand_serial\fR" 4
  433. .IX Item "-rand_serial"
  434. Generate a large random number to use as the serial number.
  435. This overrides any option or configuration to use a serial number file.
  436. .IP "\fB\-multivalue\-rdn\fR" 4
  437. .IX Item "-multivalue-rdn"
  438. This option has been deprecated and has no effect.
  439. .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4
  440. .IX Item "-rand files, -writerand file"
  441. See \*(L"Random State Options\*(R" in \fBopenssl\fR\|(1) for details.
  442. .IP "\fB\-engine\fR \fIid\fR" 4
  443. .IX Item "-engine id"
  444. See \*(L"Engine Options\*(R" in \fBopenssl\fR\|(1).
  445. This option is deprecated.
  446. .IP "\fB\-provider\fR \fIname\fR" 4
  447. .IX Item "-provider name"
  448. .PD 0
  449. .IP "\fB\-provider\-path\fR \fIpath\fR" 4
  450. .IX Item "-provider-path path"
  451. .IP "\fB\-propquery\fR \fIpropq\fR" 4
  452. .IX Item "-propquery propq"
  453. .PD
  454. See \*(L"Provider Options\*(R" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
  455. .SH "CRL OPTIONS"
  456. .IX Header "CRL OPTIONS"
  457. .IP "\fB\-gencrl\fR" 4
  458. .IX Item "-gencrl"
  459. This option generates a \s-1CRL\s0 based on information in the index file.
  460. .IP "\fB\-crl_lastupdate\fR \fItime\fR" 4
  461. .IX Item "-crl_lastupdate time"
  462. Allows the value of the \s-1CRL\s0's lastUpdate field to be explicitly set; if
  463. this option is not present, the current time is used. Accepts times in
  464. \&\s-1YYMMDDHHMMSSZ\s0 format (the same as an \s-1ASN1\s0 UTCTime structure) or
  465. \&\s-1YYYYMMDDHHMMSSZ\s0 format (the same as an \s-1ASN1\s0 GeneralizedTime structure).
  466. .IP "\fB\-crl_nextupdate\fR \fItime\fR" 4
  467. .IX Item "-crl_nextupdate time"
  468. Allows the value of the \s-1CRL\s0's nextUpdate field to be explicitly set; if
  469. this option is present, any values given for \fB\-crldays\fR, \fB\-crlhours\fR
  470. and \fB\-crlsec\fR are ignored. Accepts times in the same formats as
  471. \&\fB\-crl_lastupdate\fR.
  472. .IP "\fB\-crldays\fR \fInum\fR" 4
  473. .IX Item "-crldays num"
  474. The number of days before the next \s-1CRL\s0 is due. That is the days from
  475. now to place in the \s-1CRL\s0 nextUpdate field.
  476. .IP "\fB\-crlhours\fR \fInum\fR" 4
  477. .IX Item "-crlhours num"
  478. The number of hours before the next \s-1CRL\s0 is due.
  479. .IP "\fB\-crlsec\fR \fInum\fR" 4
  480. .IX Item "-crlsec num"
  481. The number of seconds before the next \s-1CRL\s0 is due.
  482. .IP "\fB\-revoke\fR \fIfilename\fR" 4
  483. .IX Item "-revoke filename"
  484. A filename containing a certificate to revoke.
  485. .IP "\fB\-valid\fR \fIfilename\fR" 4
  486. .IX Item "-valid filename"
  487. A filename containing a certificate to add a Valid certificate entry.
  488. .IP "\fB\-status\fR \fIserial\fR" 4
  489. .IX Item "-status serial"
  490. Displays the revocation status of the certificate with the specified
  491. serial number and exits.
  492. .IP "\fB\-updatedb\fR" 4
  493. .IX Item "-updatedb"
  494. Updates the database index to purge expired certificates.
  495. .IP "\fB\-crl_reason\fR \fIreason\fR" 4
  496. .IX Item "-crl_reason reason"
  497. Revocation reason, where \fIreason\fR is one of: \fBunspecified\fR, \fBkeyCompromise\fR,
  498. \&\fBCACompromise\fR, \fBaffiliationChanged\fR, \fBsuperseded\fR, \fBcessationOfOperation\fR,
  499. \&\fBcertificateHold\fR or \fBremoveFromCRL\fR. The matching of \fIreason\fR is case
  500. insensitive. Setting any revocation reason will make the \s-1CRL\s0 v2.
  501. .Sp
  502. In practice \fBremoveFromCRL\fR is not particularly useful because it is only used
  503. in delta CRLs which are not currently implemented.
  504. .IP "\fB\-crl_hold\fR \fIinstruction\fR" 4
  505. .IX Item "-crl_hold instruction"
  506. This sets the \s-1CRL\s0 revocation reason code to \fBcertificateHold\fR and the hold
  507. instruction to \fIinstruction\fR which must be an \s-1OID.\s0 Although any \s-1OID\s0 can be
  508. used only \fBholdInstructionNone\fR (the use of which is discouraged by \s-1RFC2459\s0)
  509. \&\fBholdInstructionCallIssuer\fR or \fBholdInstructionReject\fR will normally be used.
  510. .IP "\fB\-crl_compromise\fR \fItime\fR" 4
  511. .IX Item "-crl_compromise time"
  512. This sets the revocation reason to \fBkeyCompromise\fR and the compromise time to
  513. \&\fItime\fR. \fItime\fR should be in GeneralizedTime format that is \fI\s-1YYYYMMDDHHMMSSZ\s0\fR.
  514. .IP "\fB\-crl_CA_compromise\fR \fItime\fR" 4
  515. .IX Item "-crl_CA_compromise time"
  516. This is the same as \fBcrl_compromise\fR except the revocation reason is set to
  517. \&\fBCACompromise\fR.
  518. .IP "\fB\-crlexts\fR \fIsection\fR" 4
  519. .IX Item "-crlexts section"
  520. The section of the configuration file containing \s-1CRL\s0 extensions to
  521. include. If no \s-1CRL\s0 extension section is present then a V1 \s-1CRL\s0 is
  522. created, if the \s-1CRL\s0 extension section is present (even if it is
  523. empty) then a V2 \s-1CRL\s0 is created. The \s-1CRL\s0 extensions specified are
  524. \&\s-1CRL\s0 extensions and \fBnot\fR \s-1CRL\s0 entry extensions. It should be noted
  525. that some software (for example Netscape) can't handle V2 CRLs. See
  526. \&\fBx509v3_config\fR\|(5) manual page for details of the
  527. extension section format.
  528. .SH "CONFIGURATION FILE OPTIONS"
  529. .IX Header "CONFIGURATION FILE OPTIONS"
  530. The section of the configuration file containing options for this command
  531. is found as follows: If the \fB\-name\fR command line option is used,
  532. then it names the section to be used. Otherwise the section to
  533. be used must be named in the \fBdefault_ca\fR option of the \fBca\fR section
  534. of the configuration file (or in the default section of the
  535. configuration file). Besides \fBdefault_ca\fR, the following options are
  536. read directly from the \fBca\fR section:
  537. \s-1RANDFILE\s0
  538. preserve
  539. msie_hack
  540. With the exception of \fB\s-1RANDFILE\s0\fR, this is probably a bug and may
  541. change in future releases.
  542. .PP
  543. Many of the configuration file options are identical to command line
  544. options. Where the option is present in the configuration file
  545. and the command line the command line value is used. Where an
  546. option is described as mandatory then it must be present in
  547. the configuration file or the command line equivalent (if
  548. any) used.
  549. .IP "\fBoid_file\fR" 4
  550. .IX Item "oid_file"
  551. This specifies a file containing additional \fB\s-1OBJECT IDENTIFIERS\s0\fR.
  552. Each line of the file should consist of the numerical form of the
  553. object identifier followed by whitespace then the short name followed
  554. by whitespace and finally the long name.
  555. .IP "\fBoid_section\fR" 4
  556. .IX Item "oid_section"
  557. This specifies a section in the configuration file containing extra
  558. object identifiers. Each line should consist of the short name of the
  559. object identifier followed by \fB=\fR and the numerical form. The short
  560. and long names are the same when this option is used.
  561. .IP "\fBnew_certs_dir\fR" 4
  562. .IX Item "new_certs_dir"
  563. The same as the \fB\-outdir\fR command line option. It specifies
  564. the directory where new certificates will be placed. Mandatory.
  565. .IP "\fBcertificate\fR" 4
  566. .IX Item "certificate"
  567. The same as \fB\-cert\fR. It gives the file containing the \s-1CA\s0
  568. certificate. Mandatory.
  569. .IP "\fBprivate_key\fR" 4
  570. .IX Item "private_key"
  571. Same as the \fB\-keyfile\fR option. The file containing the
  572. \&\s-1CA\s0 private key. Mandatory.
  573. .IP "\fB\s-1RANDFILE\s0\fR" 4
  574. .IX Item "RANDFILE"
  575. At startup the specified file is loaded into the random number generator,
  576. and at exit 256 bytes will be written to it. (Note: Using a \s-1RANDFILE\s0 is
  577. not necessary anymore, see the \*(L"\s-1HISTORY\*(R"\s0 section.
  578. .IP "\fBdefault_days\fR" 4
  579. .IX Item "default_days"
  580. The same as the \fB\-days\fR option. The number of days to certify
  581. a certificate for.
  582. .IP "\fBdefault_startdate\fR" 4
  583. .IX Item "default_startdate"
  584. The same as the \fB\-startdate\fR option. The start date to certify
  585. a certificate for. If not set the current time is used.
  586. .IP "\fBdefault_enddate\fR" 4
  587. .IX Item "default_enddate"
  588. The same as the \fB\-enddate\fR option. Either this option or
  589. \&\fBdefault_days\fR (or the command line equivalents) must be
  590. present.
  591. .IP "\fBdefault_crl_hours default_crl_days\fR" 4
  592. .IX Item "default_crl_hours default_crl_days"
  593. The same as the \fB\-crlhours\fR and the \fB\-crldays\fR options. These
  594. will only be used if neither command line option is present. At
  595. least one of these must be present to generate a \s-1CRL.\s0
  596. .IP "\fBdefault_md\fR" 4
  597. .IX Item "default_md"
  598. The same as the \fB\-md\fR option. Mandatory except where the signing algorithm does
  599. not require a digest (i.e. Ed25519 and Ed448).
  600. .IP "\fBdatabase\fR" 4
  601. .IX Item "database"
  602. The text database file to use. Mandatory. This file must be present
  603. though initially it will be empty.
  604. .IP "\fBunique_subject\fR" 4
  605. .IX Item "unique_subject"
  606. If the value \fByes\fR is given, the valid certificate entries in the
  607. database must have unique subjects. if the value \fBno\fR is given,
  608. several valid certificate entries may have the exact same subject.
  609. The default value is \fByes\fR, to be compatible with older (pre 0.9.8)
  610. versions of OpenSSL. However, to make \s-1CA\s0 certificate roll-over easier,
  611. it's recommended to use the value \fBno\fR, especially if combined with
  612. the \fB\-selfsign\fR command line option.
  613. .Sp
  614. Note that it is valid in some circumstances for certificates to be created
  615. without any subject. In the case where there are multiple certificates without
  616. subjects this does not count as a duplicate.
  617. .IP "\fBserial\fR" 4
  618. .IX Item "serial"
  619. A text file containing the next serial number to use in hex. Mandatory.
  620. This file must be present and contain a valid serial number.
  621. .IP "\fBcrlnumber\fR" 4
  622. .IX Item "crlnumber"
  623. A text file containing the next \s-1CRL\s0 number to use in hex. The crl number
  624. will be inserted in the CRLs only if this file exists. If this file is
  625. present, it must contain a valid \s-1CRL\s0 number.
  626. .IP "\fBx509_extensions\fR" 4
  627. .IX Item "x509_extensions"
  628. A fallback to the \fB\-extensions\fR option.
  629. .IP "\fBcrl_extensions\fR" 4
  630. .IX Item "crl_extensions"
  631. A fallback to the \fB\-crlexts\fR option.
  632. .IP "\fBpreserve\fR" 4
  633. .IX Item "preserve"
  634. The same as \fB\-preserveDN\fR
  635. .IP "\fBemail_in_dn\fR" 4
  636. .IX Item "email_in_dn"
  637. The same as \fB\-noemailDN\fR. If you want the \s-1EMAIL\s0 field to be removed
  638. from the \s-1DN\s0 of the certificate simply set this to 'no'. If not present
  639. the default is to allow for the \s-1EMAIL\s0 filed in the certificate's \s-1DN.\s0
  640. .IP "\fBmsie_hack\fR" 4
  641. .IX Item "msie_hack"
  642. The same as \fB\-msie_hack\fR
  643. .IP "\fBpolicy\fR" 4
  644. .IX Item "policy"
  645. The same as \fB\-policy\fR. Mandatory. See the \fB\s-1POLICY FORMAT\s0\fR section
  646. for more information.
  647. .IP "\fBname_opt\fR, \fBcert_opt\fR" 4
  648. .IX Item "name_opt, cert_opt"
  649. These options allow the format used to display the certificate details
  650. when asking the user to confirm signing. All the options supported by
  651. the \fBx509\fR utilities \fB\-nameopt\fR and \fB\-certopt\fR switches can be used
  652. here, except the \fBno_signame\fR and \fBno_sigdump\fR are permanently set
  653. and cannot be disabled (this is because the certificate signature cannot
  654. be displayed because the certificate has not been signed at this point).
  655. .Sp
  656. For convenience the values \fBca_default\fR are accepted by both to produce
  657. a reasonable output.
  658. .Sp
  659. If neither option is present the format used in earlier versions of
  660. OpenSSL is used. Use of the old format is \fBstrongly\fR discouraged because
  661. it only displays fields mentioned in the \fBpolicy\fR section, mishandles
  662. multicharacter string types and does not display extensions.
  663. .IP "\fBcopy_extensions\fR" 4
  664. .IX Item "copy_extensions"
  665. Determines how extensions in certificate requests should be handled.
  666. If set to \fBnone\fR or this option is not present then extensions are
  667. ignored and not copied to the certificate. If set to \fBcopy\fR then any
  668. extensions present in the request that are not already present are copied
  669. to the certificate. If set to \fBcopyall\fR then all extensions in the
  670. request are copied to the certificate: if the extension is already present
  671. in the certificate it is deleted first. See the \fB\s-1WARNINGS\s0\fR section before
  672. using this option.
  673. .Sp
  674. The main use of this option is to allow a certificate request to supply
  675. values for certain extensions such as subjectAltName.
  676. .SH "POLICY FORMAT"
  677. .IX Header "POLICY FORMAT"
  678. The policy section consists of a set of variables corresponding to
  679. certificate \s-1DN\s0 fields. If the value is \*(L"match\*(R" then the field value
  680. must match the same field in the \s-1CA\s0 certificate. If the value is
  681. \&\*(L"supplied\*(R" then it must be present. If the value is \*(L"optional\*(R" then
  682. it may be present. Any fields not mentioned in the policy section
  683. are silently deleted, unless the \fB\-preserveDN\fR option is set but
  684. this can be regarded more of a quirk than intended behaviour.
  685. .SH "SPKAC FORMAT"
  686. .IX Header "SPKAC FORMAT"
  687. The input to the \fB\-spkac\fR command line option is a Netscape
  688. signed public key and challenge. This will usually come from
  689. the \fB\s-1KEYGEN\s0\fR tag in an \s-1HTML\s0 form to create a new private key.
  690. It is however possible to create SPKACs using \fBopenssl\-spkac\fR\|(1).
  691. .PP
  692. The file should contain the variable \s-1SPKAC\s0 set to the value of
  693. the \s-1SPKAC\s0 and also the required \s-1DN\s0 components as name value pairs.
  694. If you need to include the same component twice then it can be
  695. preceded by a number and a '.'.
  696. .PP
  697. When processing \s-1SPKAC\s0 format, the output is \s-1DER\s0 if the \fB\-out\fR
  698. flag is used, but \s-1PEM\s0 format if sending to stdout or the \fB\-outdir\fR
  699. flag is used.
  700. .SH "EXAMPLES"
  701. .IX Header "EXAMPLES"
  702. Note: these examples assume that the directory structure this command
  703. assumes is already set up and the relevant files already exist. This
  704. usually involves creating a \s-1CA\s0 certificate and private key with
  705. \&\fBopenssl\-req\fR\|(1), a serial number file and an empty index file and
  706. placing them in the relevant directories.
  707. .PP
  708. To use the sample configuration file below the directories \fIdemoCA\fR,
  709. \&\fIdemoCA/private\fR and \fIdemoCA/newcerts\fR would be created. The \s-1CA\s0
  710. certificate would be copied to \fIdemoCA/cacert.pem\fR and its private
  711. key to \fIdemoCA/private/cakey.pem\fR. A file \fIdemoCA/serial\fR would be
  712. created containing for example \*(L"01\*(R" and the empty index file
  713. \&\fIdemoCA/index.txt\fR.
  714. .PP
  715. Sign a certificate request:
  716. .PP
  717. .Vb 1
  718. \& openssl ca \-in req.pem \-out newcert.pem
  719. .Ve
  720. .PP
  721. Sign an \s-1SM2\s0 certificate request:
  722. .PP
  723. .Vb 3
  724. \& openssl ca \-in sm2.csr \-out sm2.crt \-md sm3 \e
  725. \& \-sigopt "distid:1234567812345678" \e
  726. \& \-vfyopt "distid:1234567812345678"
  727. .Ve
  728. .PP
  729. Sign a certificate request, using \s-1CA\s0 extensions:
  730. .PP
  731. .Vb 1
  732. \& openssl ca \-in req.pem \-extensions v3_ca \-out newcert.pem
  733. .Ve
  734. .PP
  735. Generate a \s-1CRL\s0
  736. .PP
  737. .Vb 1
  738. \& openssl ca \-gencrl \-out crl.pem
  739. .Ve
  740. .PP
  741. Sign several requests:
  742. .PP
  743. .Vb 1
  744. \& openssl ca \-infiles req1.pem req2.pem req3.pem
  745. .Ve
  746. .PP
  747. Certify a Netscape \s-1SPKAC:\s0
  748. .PP
  749. .Vb 1
  750. \& openssl ca \-spkac spkac.txt
  751. .Ve
  752. .PP
  753. A sample \s-1SPKAC\s0 file (the \s-1SPKAC\s0 line has been truncated for clarity):
  754. .PP
  755. .Vb 5
  756. \& SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK2A5
  757. \& CN=Steve Test
  758. \& emailAddress=steve@openssl.org
  759. \& 0.OU=OpenSSL Group
  760. \& 1.OU=Another Group
  761. .Ve
  762. .PP
  763. A sample configuration file with the relevant sections for this command:
  764. .PP
  765. .Vb 2
  766. \& [ ca ]
  767. \& default_ca = CA_default # The default ca section
  768. \&
  769. \& [ CA_default ]
  770. \&
  771. \& dir = ./demoCA # top dir
  772. \& database = $dir/index.txt # index file.
  773. \& new_certs_dir = $dir/newcerts # new certs dir
  774. \&
  775. \& certificate = $dir/cacert.pem # The CA cert
  776. \& serial = $dir/serial # serial no file
  777. \& #rand_serial = yes # for random serial#\*(Aqs
  778. \& private_key = $dir/private/cakey.pem# CA private key
  779. \&
  780. \& default_days = 365 # how long to certify for
  781. \& default_crl_days= 30 # how long before next CRL
  782. \& default_md = md5 # md to use
  783. \&
  784. \& policy = policy_any # default policy
  785. \& email_in_dn = no # Don\*(Aqt add the email into cert DN
  786. \&
  787. \& name_opt = ca_default # Subject name display option
  788. \& cert_opt = ca_default # Certificate display option
  789. \& copy_extensions = none # Don\*(Aqt copy extensions from request
  790. \&
  791. \& [ policy_any ]
  792. \& countryName = supplied
  793. \& stateOrProvinceName = optional
  794. \& organizationName = optional
  795. \& organizationalUnitName = optional
  796. \& commonName = supplied
  797. \& emailAddress = optional
  798. .Ve
  799. .SH "FILES"
  800. .IX Header "FILES"
  801. Note: the location of all files can change either by compile time options,
  802. configuration file entries, environment variables or command line options.
  803. The values below reflect the default values.
  804. .PP
  805. .Vb 9
  806. \& /usr/local/ssl/lib/openssl.cnf \- master configuration file
  807. \& ./demoCA \- main CA directory
  808. \& ./demoCA/cacert.pem \- CA certificate
  809. \& ./demoCA/private/cakey.pem \- CA private key
  810. \& ./demoCA/serial \- CA serial number file
  811. \& ./demoCA/serial.old \- CA serial number backup file
  812. \& ./demoCA/index.txt \- CA text database file
  813. \& ./demoCA/index.txt.old \- CA text database backup file
  814. \& ./demoCA/certs \- certificate output file
  815. .Ve
  816. .SH "RESTRICTIONS"
  817. .IX Header "RESTRICTIONS"
  818. The text database index file is a critical part of the process and
  819. if corrupted it can be difficult to fix. It is theoretically possible
  820. to rebuild the index file from all the issued certificates and a current
  821. \&\s-1CRL:\s0 however there is no option to do this.
  822. .PP
  823. V2 \s-1CRL\s0 features like delta CRLs are not currently supported.
  824. .PP
  825. Although several requests can be input and handled at once it is only
  826. possible to include one \s-1SPKAC\s0 or self-signed certificate.
  827. .SH "BUGS"
  828. .IX Header "BUGS"
  829. This command is quirky and at times downright unfriendly.
  830. .PP
  831. The use of an in-memory text database can cause problems when large
  832. numbers of certificates are present because, as the name implies
  833. the database has to be kept in memory.
  834. .PP
  835. This command really needs rewriting or the required functionality
  836. exposed at either a command or interface level so that a more user-friendly
  837. replacement could handle things properly. The script
  838. \&\fB\s-1CA\s0.pl\fR helps a little but not very much.
  839. .PP
  840. Any fields in a request that are not present in a policy are silently
  841. deleted. This does not happen if the \fB\-preserveDN\fR option is used. To
  842. enforce the absence of the \s-1EMAIL\s0 field within the \s-1DN,\s0 as suggested by
  843. RFCs, regardless the contents of the request' subject the \fB\-noemailDN\fR
  844. option can be used. The behaviour should be more friendly and
  845. configurable.
  846. .PP
  847. Canceling some commands by refusing to certify a certificate can
  848. create an empty file.
  849. .SH "WARNINGS"
  850. .IX Header "WARNINGS"
  851. This command was originally meant as an example of how to do things in a \s-1CA.\s0
  852. Its code does not have production quality.
  853. It was not supposed to be used as a full blown \s-1CA\s0 itself,
  854. nevertheless some people are using it for this purpose at least internally.
  855. When doing so, specific care should be taken to
  856. properly secure the private key(s) used for signing certificates.
  857. It is advisable to keep them in a secure \s-1HW\s0 storage such as a smart card or \s-1HSM\s0
  858. and access them via a suitable engine or crypto provider.
  859. .PP
  860. This command is effectively a single user command: no locking
  861. is done on the various files and attempts to run more than one \fBopenssl ca\fR
  862. command on the same database can have unpredictable results.
  863. .PP
  864. The \fBcopy_extensions\fR option should be used with caution. If care is
  865. not taken then it can be a security risk. For example if a certificate
  866. request contains a basicConstraints extension with \s-1CA:TRUE\s0 and the
  867. \&\fBcopy_extensions\fR value is set to \fBcopyall\fR and the user does not spot
  868. this when the certificate is displayed then this will hand the requester
  869. a valid \s-1CA\s0 certificate.
  870. This situation can be avoided by setting \fBcopy_extensions\fR to \fBcopy\fR
  871. and including basicConstraints with \s-1CA:FALSE\s0 in the configuration file.
  872. Then if the request contains a basicConstraints extension it will be
  873. ignored.
  874. .PP
  875. It is advisable to also include values for other extensions such
  876. as \fBkeyUsage\fR to prevent a request supplying its own values.
  877. .PP
  878. Additional restrictions can be placed on the \s-1CA\s0 certificate itself.
  879. For example if the \s-1CA\s0 certificate has:
  880. .PP
  881. .Vb 1
  882. \& basicConstraints = CA:TRUE, pathlen:0
  883. .Ve
  884. .PP
  885. then even if a certificate is issued with \s-1CA:TRUE\s0 it will not be valid.
  886. .SH "HISTORY"
  887. .IX Header "HISTORY"
  888. Since OpenSSL 1.1.1, the program follows \s-1RFC5280.\s0 Specifically,
  889. certificate validity period (specified by any of \fB\-startdate\fR,
  890. \&\fB\-enddate\fR and \fB\-days\fR) and \s-1CRL\s0 last/next update time (specified by
  891. any of \fB\-crl_lastupdate\fR, \fB\-crl_nextupdate\fR, \fB\-crldays\fR, \fB\-crlhours\fR
  892. and \fB\-crlsec\fR) will be encoded as UTCTime if the dates are
  893. earlier than year 2049 (included), and as GeneralizedTime if the dates
  894. are in year 2050 or later.
  895. .PP
  896. OpenSSL 1.1.1 introduced a new random generator (\s-1CSPRNG\s0) with an improved
  897. seeding mechanism. The new seeding mechanism makes it unnecessary to
  898. define a \s-1RANDFILE\s0 for saving and restoring randomness. This option is
  899. retained mainly for compatibility reasons.
  900. .PP
  901. The \fB\-section\fR option was added in OpenSSL 3.0.0.
  902. .PP
  903. The \fB\-multivalue\-rdn\fR option has become obsolete in OpenSSL 3.0.0 and
  904. has no effect.
  905. .PP
  906. The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
  907. .PP
  908. Since OpenSSL 3.2, generated certificates bear X.509 version 3,
  909. and key identifier extensions are included by default.
  910. .SH "SEE ALSO"
  911. .IX Header "SEE ALSO"
  912. \&\fBopenssl\fR\|(1),
  913. \&\fBopenssl\-req\fR\|(1),
  914. \&\fBopenssl\-spkac\fR\|(1),
  915. \&\fBopenssl\-x509\fR\|(1),
  916. \&\s-1\fBCA\s0.pl\fR\|(1),
  917. \&\fBconfig\fR\|(5),
  918. \&\fBx509v3_config\fR\|(5)
  919. .SH "COPYRIGHT"
  920. .IX Header "COPYRIGHT"
  921. Copyright 2000\-2024 The OpenSSL Project Authors. All Rights Reserved.
  922. .PP
  923. Licensed under the Apache License 2.0 (the \*(L"License\*(R"). You may not use
  924. this file except in compliance with the License. You can obtain a copy
  925. in the file \s-1LICENSE\s0 in the source distribution or at
  926. <https://www.openssl.org/source/license.html>.