ca.1 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
  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. .if !\nF .nr F 0
  58. .if \nF>0 \{\
  59. . de IX
  60. . tm Index:\\$1\t\\n%\t"\\$2"
  61. ..
  62. . if !\nF==2 \{\
  63. . nr % 0
  64. . nr F 2
  65. . \}
  66. .\}
  67. .\"
  68. .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
  69. .\" Fear. Run. Save yourself. No user-serviceable parts.
  70. . \" fudge factors for nroff and troff
  71. .if n \{\
  72. . ds #H 0
  73. . ds #V .8m
  74. . ds #F .3m
  75. . ds #[ \f1
  76. . ds #] \fP
  77. .\}
  78. .if t \{\
  79. . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
  80. . ds #V .6m
  81. . ds #F 0
  82. . ds #[ \&
  83. . ds #] \&
  84. .\}
  85. . \" simple accents for nroff and troff
  86. .if n \{\
  87. . ds ' \&
  88. . ds ` \&
  89. . ds ^ \&
  90. . ds , \&
  91. . ds ~ ~
  92. . ds /
  93. .\}
  94. .if t \{\
  95. . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
  96. . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
  97. . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
  98. . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
  99. . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
  100. . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
  101. .\}
  102. . \" troff and (daisy-wheel) nroff accents
  103. .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
  104. .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
  105. .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
  106. .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
  107. .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
  108. .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
  109. .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
  110. .ds ae a\h'-(\w'a'u*4/10)'e
  111. .ds Ae A\h'-(\w'A'u*4/10)'E
  112. . \" corrections for vroff
  113. .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
  114. .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
  115. . \" for low resolution devices (crt and lpr)
  116. .if \n(.H>23 .if \n(.V>19 \
  117. \{\
  118. . ds : e
  119. . ds 8 ss
  120. . ds o a
  121. . ds d- d\h'-1'\(ga
  122. . ds D- D\h'-1'\(hy
  123. . ds th \o'bp'
  124. . ds Th \o'LP'
  125. . ds ae ae
  126. . ds Ae AE
  127. .\}
  128. .rm #[ #] #H #V #F C
  129. .\" ========================================================================
  130. .\"
  131. .IX Title "CA 1"
  132. .TH CA 1 "2019-09-12" "1.0.2g" "OpenSSL"
  133. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  134. .\" way too many mistakes in technical documents.
  135. .if n .ad l
  136. .nh
  137. .SH "NAME"
  138. ca \- sample minimal CA application
  139. .SH "SYNOPSIS"
  140. .IX Header "SYNOPSIS"
  141. \&\fBopenssl\fR \fBca\fR
  142. [\fB\-verbose\fR]
  143. [\fB\-config filename\fR]
  144. [\fB\-name section\fR]
  145. [\fB\-gencrl\fR]
  146. [\fB\-revoke file\fR]
  147. [\fB\-status serial\fR]
  148. [\fB\-updatedb\fR]
  149. [\fB\-crl_reason reason\fR]
  150. [\fB\-crl_hold instruction\fR]
  151. [\fB\-crl_compromise time\fR]
  152. [\fB\-crl_CA_compromise time\fR]
  153. [\fB\-crldays days\fR]
  154. [\fB\-crlhours hours\fR]
  155. [\fB\-crlexts section\fR]
  156. [\fB\-startdate date\fR]
  157. [\fB\-enddate date\fR]
  158. [\fB\-days arg\fR]
  159. [\fB\-md arg\fR]
  160. [\fB\-policy arg\fR]
  161. [\fB\-keyfile arg\fR]
  162. [\fB\-keyform PEM|DER\fR]
  163. [\fB\-key arg\fR]
  164. [\fB\-passin arg\fR]
  165. [\fB\-cert file\fR]
  166. [\fB\-selfsign\fR]
  167. [\fB\-in file\fR]
  168. [\fB\-out file\fR]
  169. [\fB\-notext\fR]
  170. [\fB\-outdir dir\fR]
  171. [\fB\-infiles\fR]
  172. [\fB\-spkac file\fR]
  173. [\fB\-ss_cert file\fR]
  174. [\fB\-preserveDN\fR]
  175. [\fB\-noemailDN\fR]
  176. [\fB\-batch\fR]
  177. [\fB\-msie_hack\fR]
  178. [\fB\-extensions section\fR]
  179. [\fB\-extfile section\fR]
  180. [\fB\-engine id\fR]
  181. [\fB\-subj arg\fR]
  182. [\fB\-utf8\fR]
  183. [\fB\-multivalue\-rdn\fR]
  184. .SH "DESCRIPTION"
  185. .IX Header "DESCRIPTION"
  186. The \fBca\fR command is a minimal \s-1CA\s0 application. It can be used
  187. to sign certificate requests in a variety of forms and generate
  188. CRLs it also maintains a text database of issued certificates
  189. and their status.
  190. .PP
  191. The options descriptions will be divided into each purpose.
  192. .SH "CA OPTIONS"
  193. .IX Header "CA OPTIONS"
  194. .IP "\fB\-config filename\fR" 4
  195. .IX Item "-config filename"
  196. specifies the configuration file to use.
  197. .IP "\fB\-name section\fR" 4
  198. .IX Item "-name section"
  199. specifies the configuration file section to use (overrides
  200. \&\fBdefault_ca\fR in the \fBca\fR section).
  201. .IP "\fB\-in filename\fR" 4
  202. .IX Item "-in filename"
  203. an input filename containing a single certificate request to be
  204. signed by the \s-1CA.\s0
  205. .IP "\fB\-ss_cert filename\fR" 4
  206. .IX Item "-ss_cert filename"
  207. a single self signed certificate to be signed by the \s-1CA.\s0
  208. .IP "\fB\-spkac filename\fR" 4
  209. .IX Item "-spkac filename"
  210. a file containing a single Netscape signed public key and challenge
  211. and additional field values to be signed by the \s-1CA.\s0 See the \fB\s-1SPKAC FORMAT\s0\fR
  212. section for information on the required input and output format.
  213. .IP "\fB\-infiles\fR" 4
  214. .IX Item "-infiles"
  215. if present this should be the last option, all subsequent arguments
  216. are assumed to the the names of files containing certificate requests.
  217. .IP "\fB\-out filename\fR" 4
  218. .IX Item "-out filename"
  219. the output file to output certificates to. The default is standard
  220. output. The certificate details will also be printed out to this
  221. file in \s-1PEM\s0 format (except that \fB\-spkac\fR outputs \s-1DER\s0 format).
  222. .IP "\fB\-outdir directory\fR" 4
  223. .IX Item "-outdir directory"
  224. the directory to output certificates to. The certificate will be
  225. written to a filename consisting of the serial number in hex with
  226. \&\*(L".pem\*(R" appended.
  227. .IP "\fB\-cert\fR" 4
  228. .IX Item "-cert"
  229. the \s-1CA\s0 certificate file.
  230. .IP "\fB\-keyfile filename\fR" 4
  231. .IX Item "-keyfile filename"
  232. the private key to sign requests with.
  233. .IP "\fB\-keyform PEM|DER\fR" 4
  234. .IX Item "-keyform PEM|DER"
  235. the format of the data in the private key file.
  236. The default is \s-1PEM.\s0
  237. .IP "\fB\-key password\fR" 4
  238. .IX Item "-key password"
  239. the password used to encrypt the private key. Since on some
  240. systems the command line arguments are visible (e.g. Unix with
  241. the 'ps' utility) this option should be used with caution.
  242. .IP "\fB\-selfsign\fR" 4
  243. .IX Item "-selfsign"
  244. indicates the issued certificates are to be signed with the key
  245. the certificate requests were signed with (given with \fB\-keyfile\fR).
  246. Cerificate requests signed with a different key are ignored. If
  247. \&\fB\-spkac\fR, \fB\-ss_cert\fR or \fB\-gencrl\fR are given, \fB\-selfsign\fR is
  248. ignored.
  249. .Sp
  250. A consequence of using \fB\-selfsign\fR is that the self-signed
  251. certificate appears among the entries in the certificate database
  252. (see the configuration option \fBdatabase\fR), and uses the same
  253. serial number counter as all other certificates sign with the
  254. self-signed certificate.
  255. .IP "\fB\-passin arg\fR" 4
  256. .IX Item "-passin arg"
  257. the key password source. For more information about the format of \fBarg\fR
  258. see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
  259. .IP "\fB\-verbose\fR" 4
  260. .IX Item "-verbose"
  261. this prints extra details about the operations being performed.
  262. .IP "\fB\-notext\fR" 4
  263. .IX Item "-notext"
  264. don't output the text form of a certificate to the output file.
  265. .IP "\fB\-startdate date\fR" 4
  266. .IX Item "-startdate date"
  267. this allows the start date to be explicitly set. The format of the
  268. date is \s-1YYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 UTCTime structure).
  269. .IP "\fB\-enddate date\fR" 4
  270. .IX Item "-enddate date"
  271. this allows the expiry date to be explicitly set. The format of the
  272. date is \s-1YYMMDDHHMMSSZ\s0 (the same as an \s-1ASN1\s0 UTCTime structure).
  273. .IP "\fB\-days arg\fR" 4
  274. .IX Item "-days arg"
  275. the number of days to certify the certificate for.
  276. .IP "\fB\-md alg\fR" 4
  277. .IX Item "-md alg"
  278. the message digest to use. Possible values include md5, sha1 and mdc2.
  279. This option also applies to CRLs.
  280. .IP "\fB\-policy arg\fR" 4
  281. .IX Item "-policy arg"
  282. this option defines the \s-1CA\s0 \*(L"policy\*(R" to use. This is a section in
  283. the configuration file which decides which fields should be mandatory
  284. or match the \s-1CA\s0 certificate. Check out the \fB\s-1POLICY FORMAT\s0\fR section
  285. for more information.
  286. .IP "\fB\-msie_hack\fR" 4
  287. .IX Item "-msie_hack"
  288. this is a legacy option to make \fBca\fR work with very old versions of
  289. the \s-1IE\s0 certificate enrollment control \*(L"certenr3\*(R". It used UniversalStrings
  290. for almost everything. Since the old control has various security bugs
  291. its use is strongly discouraged. The newer control \*(L"Xenroll\*(R" does not
  292. need this option.
  293. .IP "\fB\-preserveDN\fR" 4
  294. .IX Item "-preserveDN"
  295. Normally the \s-1DN\s0 order of a certificate is the same as the order of the
  296. fields in the relevant policy section. When this option is set the order
  297. is the same as the request. This is largely for compatibility with the
  298. older \s-1IE\s0 enrollment control which would only accept certificates if their
  299. DNs match the order of the request. This is not needed for Xenroll.
  300. .IP "\fB\-noemailDN\fR" 4
  301. .IX Item "-noemailDN"
  302. The \s-1DN\s0 of a certificate can contain the \s-1EMAIL\s0 field if present in the
  303. request \s-1DN,\s0 however it is good policy just having the e\-mail set into
  304. the altName extension of the certificate. When this option is set the
  305. \&\s-1EMAIL\s0 field is removed from the certificate' subject and set only in
  306. the, eventually present, extensions. The \fBemail_in_dn\fR keyword can be
  307. used in the configuration file to enable this behaviour.
  308. .IP "\fB\-batch\fR" 4
  309. .IX Item "-batch"
  310. this sets the batch mode. In this mode no questions will be asked
  311. and all certificates will be certified automatically.
  312. .IP "\fB\-extensions section\fR" 4
  313. .IX Item "-extensions section"
  314. the section of the configuration file containing certificate extensions
  315. to be added when a certificate is issued (defaults to \fBx509_extensions\fR
  316. unless the \fB\-extfile\fR option is used). If no extension section is
  317. present then, a V1 certificate is created. If the extension section
  318. is present (even if it is empty), then a V3 certificate is created. See the:w
  319. \&\fIx509v3_config\fR\|(5) manual page for details of the
  320. extension section format.
  321. .IP "\fB\-extfile file\fR" 4
  322. .IX Item "-extfile file"
  323. an additional configuration file to read certificate extensions from
  324. (using the default section unless the \fB\-extensions\fR option is also
  325. used).
  326. .IP "\fB\-engine id\fR" 4
  327. .IX Item "-engine id"
  328. specifying an engine (by its unique \fBid\fR string) will cause \fBca\fR
  329. to attempt to obtain a functional reference to the specified engine,
  330. thus initialising it if needed. The engine will then be set as the default
  331. for all available algorithms.
  332. .IP "\fB\-subj arg\fR" 4
  333. .IX Item "-subj arg"
  334. supersedes subject name given in the request.
  335. The arg must be formatted as \fI/type0=value0/type1=value1/type2=...\fR,
  336. characters may be escaped by \e (backslash), no spaces are skipped.
  337. .IP "\fB\-utf8\fR" 4
  338. .IX Item "-utf8"
  339. this option causes field values to be interpreted as \s-1UTF8\s0 strings, by
  340. default they are interpreted as \s-1ASCII.\s0 This means that the field
  341. values, whether prompted from a terminal or obtained from a
  342. configuration file, must be valid \s-1UTF8\s0 strings.
  343. .IP "\fB\-multivalue\-rdn\fR" 4
  344. .IX Item "-multivalue-rdn"
  345. this option causes the \-subj argument to be interpretedt with full
  346. support for multivalued RDNs. Example:
  347. .Sp
  348. \&\fI/DC=org/DC=OpenSSL/DC=users/UID=123456+CN=John Doe\fR
  349. .Sp
  350. If \-multi\-rdn is not used then the \s-1UID\s0 value is \fI123456+CN=John Doe\fR.
  351. .SH "CRL OPTIONS"
  352. .IX Header "CRL OPTIONS"
  353. .IP "\fB\-gencrl\fR" 4
  354. .IX Item "-gencrl"
  355. this option generates a \s-1CRL\s0 based on information in the index file.
  356. .IP "\fB\-crldays num\fR" 4
  357. .IX Item "-crldays num"
  358. the number of days before the next \s-1CRL\s0 is due. That is the days from
  359. now to place in the \s-1CRL\s0 nextUpdate field.
  360. .IP "\fB\-crlhours num\fR" 4
  361. .IX Item "-crlhours num"
  362. the number of hours before the next \s-1CRL\s0 is due.
  363. .IP "\fB\-revoke filename\fR" 4
  364. .IX Item "-revoke filename"
  365. a filename containing a certificate to revoke.
  366. .IP "\fB\-status serial\fR" 4
  367. .IX Item "-status serial"
  368. displays the revocation status of the certificate with the specified
  369. serial number and exits.
  370. .IP "\fB\-updatedb\fR" 4
  371. .IX Item "-updatedb"
  372. Updates the database index to purge expired certificates.
  373. .IP "\fB\-crl_reason reason\fR" 4
  374. .IX Item "-crl_reason reason"
  375. revocation reason, where \fBreason\fR is one of: \fBunspecified\fR, \fBkeyCompromise\fR,
  376. \&\fBCACompromise\fR, \fBaffiliationChanged\fR, \fBsuperseded\fR, \fBcessationOfOperation\fR,
  377. \&\fBcertificateHold\fR or \fBremoveFromCRL\fR. The matching of \fBreason\fR is case
  378. insensitive. Setting any revocation reason will make the \s-1CRL\s0 v2.
  379. .Sp
  380. In practive \fBremoveFromCRL\fR is not particularly useful because it is only used
  381. in delta CRLs which are not currently implemented.
  382. .IP "\fB\-crl_hold instruction\fR" 4
  383. .IX Item "-crl_hold instruction"
  384. This sets the \s-1CRL\s0 revocation reason code to \fBcertificateHold\fR and the hold
  385. instruction to \fBinstruction\fR which must be an \s-1OID.\s0 Although any \s-1OID\s0 can be
  386. used only \fBholdInstructionNone\fR (the use of which is discouraged by \s-1RFC2459\s0)
  387. \&\fBholdInstructionCallIssuer\fR or \fBholdInstructionReject\fR will normally be used.
  388. .IP "\fB\-crl_compromise time\fR" 4
  389. .IX Item "-crl_compromise time"
  390. This sets the revocation reason to \fBkeyCompromise\fR and the compromise time to
  391. \&\fBtime\fR. \fBtime\fR should be in GeneralizedTime format that is \fB\s-1YYYYMMDDHHMMSSZ\s0\fR.
  392. .IP "\fB\-crl_CA_compromise time\fR" 4
  393. .IX Item "-crl_CA_compromise time"
  394. This is the same as \fBcrl_compromise\fR except the revocation reason is set to
  395. \&\fBCACompromise\fR.
  396. .IP "\fB\-crlexts section\fR" 4
  397. .IX Item "-crlexts section"
  398. the section of the configuration file containing \s-1CRL\s0 extensions to
  399. include. If no \s-1CRL\s0 extension section is present then a V1 \s-1CRL\s0 is
  400. created, if the \s-1CRL\s0 extension section is present (even if it is
  401. empty) then a V2 \s-1CRL\s0 is created. The \s-1CRL\s0 extensions specified are
  402. \&\s-1CRL\s0 extensions and \fBnot\fR \s-1CRL\s0 entry extensions. It should be noted
  403. that some software (for example Netscape) can't handle V2 CRLs. See
  404. \&\fIx509v3_config\fR\|(5) manual page for details of the
  405. extension section format.
  406. .SH "CONFIGURATION FILE OPTIONS"
  407. .IX Header "CONFIGURATION FILE OPTIONS"
  408. The section of the configuration file containing options for \fBca\fR
  409. is found as follows: If the \fB\-name\fR command line option is used,
  410. then it names the section to be used. Otherwise the section to
  411. be used must be named in the \fBdefault_ca\fR option of the \fBca\fR section
  412. of the configuration file (or in the default section of the
  413. configuration file). Besides \fBdefault_ca\fR, the following options are
  414. read directly from the \fBca\fR section:
  415. \s-1RANDFILE\s0
  416. preserve
  417. msie_hack
  418. With the exception of \fB\s-1RANDFILE\s0\fR, this is probably a bug and may
  419. change in future releases.
  420. .PP
  421. Many of the configuration file options are identical to command line
  422. options. Where the option is present in the configuration file
  423. and the command line the command line value is used. Where an
  424. option is described as mandatory then it must be present in
  425. the configuration file or the command line equivalent (if
  426. any) used.
  427. .IP "\fBoid_file\fR" 4
  428. .IX Item "oid_file"
  429. This specifies a file containing additional \fB\s-1OBJECT IDENTIFIERS\s0\fR.
  430. Each line of the file should consist of the numerical form of the
  431. object identifier followed by white space then the short name followed
  432. by white space and finally the long name.
  433. .IP "\fBoid_section\fR" 4
  434. .IX Item "oid_section"
  435. This specifies a section in the configuration file containing extra
  436. object identifiers. Each line should consist of the short name of the
  437. object identifier followed by \fB=\fR and the numerical form. The short
  438. and long names are the same when this option is used.
  439. .IP "\fBnew_certs_dir\fR" 4
  440. .IX Item "new_certs_dir"
  441. the same as the \fB\-outdir\fR command line option. It specifies
  442. the directory where new certificates will be placed. Mandatory.
  443. .IP "\fBcertificate\fR" 4
  444. .IX Item "certificate"
  445. the same as \fB\-cert\fR. It gives the file containing the \s-1CA\s0
  446. certificate. Mandatory.
  447. .IP "\fBprivate_key\fR" 4
  448. .IX Item "private_key"
  449. same as the \fB\-keyfile\fR option. The file containing the
  450. \&\s-1CA\s0 private key. Mandatory.
  451. .IP "\fB\s-1RANDFILE\s0\fR" 4
  452. .IX Item "RANDFILE"
  453. a file used to read and write random number seed information, or
  454. an \s-1EGD\s0 socket (see \fIRAND_egd\fR\|(3)).
  455. .IP "\fBdefault_days\fR" 4
  456. .IX Item "default_days"
  457. the same as the \fB\-days\fR option. The number of days to certify
  458. a certificate for.
  459. .IP "\fBdefault_startdate\fR" 4
  460. .IX Item "default_startdate"
  461. the same as the \fB\-startdate\fR option. The start date to certify
  462. a certificate for. If not set the current time is used.
  463. .IP "\fBdefault_enddate\fR" 4
  464. .IX Item "default_enddate"
  465. the same as the \fB\-enddate\fR option. Either this option or
  466. \&\fBdefault_days\fR (or the command line equivalents) must be
  467. present.
  468. .IP "\fBdefault_crl_hours default_crl_days\fR" 4
  469. .IX Item "default_crl_hours default_crl_days"
  470. the same as the \fB\-crlhours\fR and the \fB\-crldays\fR options. These
  471. will only be used if neither command line option is present. At
  472. least one of these must be present to generate a \s-1CRL.\s0
  473. .IP "\fBdefault_md\fR" 4
  474. .IX Item "default_md"
  475. the same as the \fB\-md\fR option. The message digest to use. Mandatory.
  476. .IP "\fBdatabase\fR" 4
  477. .IX Item "database"
  478. the text database file to use. Mandatory. This file must be present
  479. though initially it will be empty.
  480. .IP "\fBunique_subject\fR" 4
  481. .IX Item "unique_subject"
  482. if the value \fByes\fR is given, the valid certificate entries in the
  483. database must have unique subjects. if the value \fBno\fR is given,
  484. several valid certificate entries may have the exact same subject.
  485. The default value is \fByes\fR, to be compatible with older (pre 0.9.8)
  486. versions of OpenSSL. However, to make \s-1CA\s0 certificate roll-over easier,
  487. it's recommended to use the value \fBno\fR, especially if combined with
  488. the \fB\-selfsign\fR command line option.
  489. .IP "\fBserial\fR" 4
  490. .IX Item "serial"
  491. a text file containing the next serial number to use in hex. Mandatory.
  492. This file must be present and contain a valid serial number.
  493. .IP "\fBcrlnumber\fR" 4
  494. .IX Item "crlnumber"
  495. a text file containing the next \s-1CRL\s0 number to use in hex. The crl number
  496. will be inserted in the CRLs only if this file exists. If this file is
  497. present, it must contain a valid \s-1CRL\s0 number.
  498. .IP "\fBx509_extensions\fR" 4
  499. .IX Item "x509_extensions"
  500. the same as \fB\-extensions\fR.
  501. .IP "\fBcrl_extensions\fR" 4
  502. .IX Item "crl_extensions"
  503. the same as \fB\-crlexts\fR.
  504. .IP "\fBpreserve\fR" 4
  505. .IX Item "preserve"
  506. the same as \fB\-preserveDN\fR
  507. .IP "\fBemail_in_dn\fR" 4
  508. .IX Item "email_in_dn"
  509. the same as \fB\-noemailDN\fR. If you want the \s-1EMAIL\s0 field to be removed
  510. from the \s-1DN\s0 of the certificate simply set this to 'no'. If not present
  511. the default is to allow for the \s-1EMAIL\s0 filed in the certificate's \s-1DN.\s0
  512. .IP "\fBmsie_hack\fR" 4
  513. .IX Item "msie_hack"
  514. the same as \fB\-msie_hack\fR
  515. .IP "\fBpolicy\fR" 4
  516. .IX Item "policy"
  517. the same as \fB\-policy\fR. Mandatory. See the \fB\s-1POLICY FORMAT\s0\fR section
  518. for more information.
  519. .IP "\fBname_opt\fR, \fBcert_opt\fR" 4
  520. .IX Item "name_opt, cert_opt"
  521. these options allow the format used to display the certificate details
  522. when asking the user to confirm signing. All the options supported by
  523. the \fBx509\fR utilities \fB\-nameopt\fR and \fB\-certopt\fR switches can be used
  524. here, except the \fBno_signame\fR and \fBno_sigdump\fR are permanently set
  525. and cannot be disabled (this is because the certificate signature cannot
  526. be displayed because the certificate has not been signed at this point).
  527. .Sp
  528. For convenience the values \fBca_default\fR are accepted by both to produce
  529. a reasonable output.
  530. .Sp
  531. If neither option is present the format used in earlier versions of
  532. OpenSSL is used. Use of the old format is \fBstrongly\fR discouraged because
  533. it only displays fields mentioned in the \fBpolicy\fR section, mishandles
  534. multicharacter string types and does not display extensions.
  535. .IP "\fBcopy_extensions\fR" 4
  536. .IX Item "copy_extensions"
  537. determines how extensions in certificate requests should be handled.
  538. If set to \fBnone\fR or this option is not present then extensions are
  539. ignored and not copied to the certificate. If set to \fBcopy\fR then any
  540. extensions present in the request that are not already present are copied
  541. to the certificate. If set to \fBcopyall\fR then all extensions in the
  542. request are copied to the certificate: if the extension is already present
  543. in the certificate it is deleted first. See the \fB\s-1WARNINGS\s0\fR section before
  544. using this option.
  545. .Sp
  546. The main use of this option is to allow a certificate request to supply
  547. values for certain extensions such as subjectAltName.
  548. .SH "POLICY FORMAT"
  549. .IX Header "POLICY FORMAT"
  550. The policy section consists of a set of variables corresponding to
  551. certificate \s-1DN\s0 fields. If the value is \*(L"match\*(R" then the field value
  552. must match the same field in the \s-1CA\s0 certificate. If the value is
  553. \&\*(L"supplied\*(R" then it must be present. If the value is \*(L"optional\*(R" then
  554. it may be present. Any fields not mentioned in the policy section
  555. are silently deleted, unless the \fB\-preserveDN\fR option is set but
  556. this can be regarded more of a quirk than intended behaviour.
  557. .SH "SPKAC FORMAT"
  558. .IX Header "SPKAC FORMAT"
  559. The input to the \fB\-spkac\fR command line option is a Netscape
  560. signed public key and challenge. This will usually come from
  561. the \fB\s-1KEYGEN\s0\fR tag in an \s-1HTML\s0 form to create a new private key.
  562. It is however possible to create SPKACs using the \fBspkac\fR utility.
  563. .PP
  564. The file should contain the variable \s-1SPKAC\s0 set to the value of
  565. the \s-1SPKAC\s0 and also the required \s-1DN\s0 components as name value pairs.
  566. If you need to include the same component twice then it can be
  567. preceded by a number and a '.'.
  568. .PP
  569. When processing \s-1SPKAC\s0 format, the output is \s-1DER\s0 if the \fB\-out\fR
  570. flag is used, but \s-1PEM\s0 format if sending to stdout or the \fB\-outdir\fR
  571. flag is used.
  572. .SH "EXAMPLES"
  573. .IX Header "EXAMPLES"
  574. Note: these examples assume that the \fBca\fR directory structure is
  575. already set up and the relevant files already exist. This usually
  576. involves creating a \s-1CA\s0 certificate and private key with \fBreq\fR, a
  577. serial number file and an empty index file and placing them in
  578. the relevant directories.
  579. .PP
  580. To use the sample configuration file below the directories demoCA,
  581. demoCA/private and demoCA/newcerts would be created. The \s-1CA\s0
  582. certificate would be copied to demoCA/cacert.pem and its private
  583. key to demoCA/private/cakey.pem. A file demoCA/serial would be
  584. created containing for example \*(L"01\*(R" and the empty index file
  585. demoCA/index.txt.
  586. .PP
  587. Sign a certificate request:
  588. .PP
  589. .Vb 1
  590. \& openssl ca \-in req.pem \-out newcert.pem
  591. .Ve
  592. .PP
  593. Sign a certificate request, using \s-1CA\s0 extensions:
  594. .PP
  595. .Vb 1
  596. \& openssl ca \-in req.pem \-extensions v3_ca \-out newcert.pem
  597. .Ve
  598. .PP
  599. Generate a \s-1CRL\s0
  600. .PP
  601. .Vb 1
  602. \& openssl ca \-gencrl \-out crl.pem
  603. .Ve
  604. .PP
  605. Sign several requests:
  606. .PP
  607. .Vb 1
  608. \& openssl ca \-infiles req1.pem req2.pem req3.pem
  609. .Ve
  610. .PP
  611. Certify a Netscape \s-1SPKAC:\s0
  612. .PP
  613. .Vb 1
  614. \& openssl ca \-spkac spkac.txt
  615. .Ve
  616. .PP
  617. A sample \s-1SPKAC\s0 file (the \s-1SPKAC\s0 line has been truncated for clarity):
  618. .PP
  619. .Vb 5
  620. \& SPKAC=MIG0MGAwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAn7PDhCeV/xIxUg8V70YRxK2A5
  621. \& CN=Steve Test
  622. \& emailAddress=steve@openssl.org
  623. \& 0.OU=OpenSSL Group
  624. \& 1.OU=Another Group
  625. .Ve
  626. .PP
  627. A sample configuration file with the relevant sections for \fBca\fR:
  628. .PP
  629. .Vb 2
  630. \& [ ca ]
  631. \& default_ca = CA_default # The default ca section
  632. \&
  633. \& [ CA_default ]
  634. \&
  635. \& dir = ./demoCA # top dir
  636. \& database = $dir/index.txt # index file.
  637. \& new_certs_dir = $dir/newcerts # new certs dir
  638. \&
  639. \& certificate = $dir/cacert.pem # The CA cert
  640. \& serial = $dir/serial # serial no file
  641. \& private_key = $dir/private/cakey.pem# CA private key
  642. \& RANDFILE = $dir/private/.rand # random number file
  643. \&
  644. \& default_days = 365 # how long to certify for
  645. \& default_crl_days= 30 # how long before next CRL
  646. \& default_md = md5 # md to use
  647. \&
  648. \& policy = policy_any # default policy
  649. \& email_in_dn = no # Don\*(Aqt add the email into cert DN
  650. \&
  651. \& name_opt = ca_default # Subject name display option
  652. \& cert_opt = ca_default # Certificate display option
  653. \& copy_extensions = none # Don\*(Aqt copy extensions from request
  654. \&
  655. \& [ policy_any ]
  656. \& countryName = supplied
  657. \& stateOrProvinceName = optional
  658. \& organizationName = optional
  659. \& organizationalUnitName = optional
  660. \& commonName = supplied
  661. \& emailAddress = optional
  662. .Ve
  663. .SH "FILES"
  664. .IX Header "FILES"
  665. Note: the location of all files can change either by compile time options,
  666. configuration file entries, environment variables or command line options.
  667. The values below reflect the default values.
  668. .PP
  669. .Vb 10
  670. \& /usr/local/ssl/lib/openssl.cnf \- master configuration file
  671. \& ./demoCA \- main CA directory
  672. \& ./demoCA/cacert.pem \- CA certificate
  673. \& ./demoCA/private/cakey.pem \- CA private key
  674. \& ./demoCA/serial \- CA serial number file
  675. \& ./demoCA/serial.old \- CA serial number backup file
  676. \& ./demoCA/index.txt \- CA text database file
  677. \& ./demoCA/index.txt.old \- CA text database backup file
  678. \& ./demoCA/certs \- certificate output file
  679. \& ./demoCA/.rnd \- CA random seed information
  680. .Ve
  681. .SH "ENVIRONMENT VARIABLES"
  682. .IX Header "ENVIRONMENT VARIABLES"
  683. \&\fB\s-1OPENSSL_CONF\s0\fR reflects the location of master configuration file it can
  684. be overridden by the \fB\-config\fR command line option.
  685. .SH "RESTRICTIONS"
  686. .IX Header "RESTRICTIONS"
  687. The text database index file is a critical part of the process and
  688. if corrupted it can be difficult to fix. It is theoretically possible
  689. to rebuild the index file from all the issued certificates and a current
  690. \&\s-1CRL:\s0 however there is no option to do this.
  691. .PP
  692. V2 \s-1CRL\s0 features like delta CRLs are not currently supported.
  693. .PP
  694. Although several requests can be input and handled at once it is only
  695. possible to include one \s-1SPKAC\s0 or self signed certificate.
  696. .SH "BUGS"
  697. .IX Header "BUGS"
  698. The use of an in memory text database can cause problems when large
  699. numbers of certificates are present because, as the name implies
  700. the database has to be kept in memory.
  701. .PP
  702. The \fBca\fR command really needs rewriting or the required functionality
  703. exposed at either a command or interface level so a more friendly utility
  704. (perl script or \s-1GUI\s0) can handle things properly. The scripts \fB\s-1CA\s0.sh\fR and
  705. \&\fB\s-1CA\s0.pl\fR help a little but not very much.
  706. .PP
  707. Any fields in a request that are not present in a policy are silently
  708. deleted. This does not happen if the \fB\-preserveDN\fR option is used. To
  709. enforce the absence of the \s-1EMAIL\s0 field within the \s-1DN,\s0 as suggested by
  710. RFCs, regardless the contents of the request' subject the \fB\-noemailDN\fR
  711. option can be used. The behaviour should be more friendly and
  712. configurable.
  713. .PP
  714. Cancelling some commands by refusing to certify a certificate can
  715. create an empty file.
  716. .SH "WARNINGS"
  717. .IX Header "WARNINGS"
  718. The \fBca\fR command is quirky and at times downright unfriendly.
  719. .PP
  720. The \fBca\fR utility was originally meant as an example of how to do things
  721. in a \s-1CA.\s0 It was not supposed to be used as a full blown \s-1CA\s0 itself:
  722. nevertheless some people are using it for this purpose.
  723. .PP
  724. The \fBca\fR command is effectively a single user command: no locking is
  725. done on the various files and attempts to run more than one \fBca\fR command
  726. on the same database can have unpredictable results.
  727. .PP
  728. The \fBcopy_extensions\fR option should be used with caution. If care is
  729. not taken then it can be a security risk. For example if a certificate
  730. request contains a basicConstraints extension with \s-1CA:TRUE\s0 and the
  731. \&\fBcopy_extensions\fR value is set to \fBcopyall\fR and the user does not spot
  732. this when the certificate is displayed then this will hand the requestor
  733. a valid \s-1CA\s0 certificate.
  734. .PP
  735. This situation can be avoided by setting \fBcopy_extensions\fR to \fBcopy\fR
  736. and including basicConstraints with \s-1CA:FALSE\s0 in the configuration file.
  737. Then if the request contains a basicConstraints extension it will be
  738. ignored.
  739. .PP
  740. It is advisable to also include values for other extensions such
  741. as \fBkeyUsage\fR to prevent a request supplying its own values.
  742. .PP
  743. Additional restrictions can be placed on the \s-1CA\s0 certificate itself.
  744. For example if the \s-1CA\s0 certificate has:
  745. .PP
  746. .Vb 1
  747. \& basicConstraints = CA:TRUE, pathlen:0
  748. .Ve
  749. .PP
  750. then even if a certificate is issued with \s-1CA:TRUE\s0 it will not be valid.
  751. .SH "SEE ALSO"
  752. .IX Header "SEE ALSO"
  753. \&\fIreq\fR\|(1), \fIspkac\fR\|(1), \fIx509\fR\|(1), \s-1\fICA\s0.pl\fR\|(1),
  754. \&\fIconfig\fR\|(5), \fIx509v3_config\fR\|(5)