xca.sgml
上传用户:stc1860
上传日期:2007-01-12
资源大小:234k
文件大小:18k
源码类别:

CA认证

开发平台:

MultiPlatform

  1. <!doctype linuxdoc system>
  2. <article>
  3. <title>XCA <!-- insert your title here -->
  4. <author>Christian Hohnst鋎t, <tt/christian@hohnstaedt.de/ <!-- insert your name here -->
  5. <date>$Date: 2002/12/17 21:56:29 $            <!-- always have a version number and a date -->
  6. <abstract>                          <!-- the abstract: a short and precise description -->
  7. <nidx>(your index root)</nidx>    <!-- add indexing keywords as you go along -->
  8.                          <!-- nidx means the indexed word is not in output of main text, only in the index -->
  9. This application is intended for creating and managing X.509 certificates
  10. and RSA keys (DSA keys maybe supported in a later release
  11. since they are not wideley used in PKI cryptography).
  12. Everything that is needed for a CA is implemented.
  13. All CAs can sign sub-CAs rekursively. These certificate chains are shown clearly in a list-view.
  14. For an easy company-wide use there are customiseable templates that can be used for certificate or request generation.
  15. All crypto data is stored in a local Berkeley database. 
  16. </abstract>
  17. <!-- Table of contents -->
  18. <toc>
  19. <!-- Begin the document -->
  20. <sect>Introduction
  21. <p>
  22. <nidx>(your index root)!introduction</nidx>   <!-- here introduction is a sub entry of template, exclamationmark is separator -->
  23. This application is intended as Certificate and Keystore and as 
  24. signing application issuing certificates.
  25. <p>
  26. All datastructures (Keys, Certificate signing requests, Certificates and Templates) can be imported
  27. and exported in several formats like DER or PEM.
  28. Import means reading a file from the filesystem and storing the datastructure
  29. into the databasefile, while exporting means to write the datastructure
  30. from the databasefile to the filesystem to be e.g imported to an other application.
  31. <p>
  32. When starting the application the first time, it needs a password to encrypt the
  33. private keys in the database.
  34. After starting the application all RSA keys are hold <bf>unencrypted</bf> in the RAM of the computer.
  35. This is a security issue to be aware of.
  36. <p>
  37. The different parts are divided over 4 Tabs: Keys, Requests, Certificates and Templates.
  38. All items can be manipulated either by a context menu available by
  39. right-clicking on the item, or by using the buttons at the right border.
  40. Every item gets an internal name which is unique in one tab-view and is
  41. always shown in the first column.
  42. <sect1>File formats
  43. <p>
  44. There are several default file-formats to exchange cryptographic the data with
  45. other applications.
  46. <itemize>
  47. <item><bf>DER</bf> is the ASN.1 encoding of the data.
  48. <item><bf>PEM</bf> is the base64 encoded version of the <bf>DER</bf> formatted data 
  49. with additional header and footer lines to be transported via e.g. E-mail
  50. <item><bf>PKCS&num;X</bf> <bf>P</bf>ublic <bf>K</bf>ey <bf>C</bf>ryptography <bf>S</bf>tandards 
  51. published by <url url="http://www.rsasecurity.com" name="RSA Laboratories">
  52. </itemize>
  53. <sect1>Further reading <label id="otherdoc">
  54. <p>
  55. <enum>
  56. <item><url url="http://tldp.org/HOWTO/SSL-Certificates-HOWTO/" name="SSL Certificates HOWTO">
  57. <item><url url="http://ospkibook.sourceforge.net/" name="OS-PKI book">
  58. </enum>
  59. <sect1>Copyright
  60. <p>
  61. <tscreen><verb>
  62. /*
  63.  * Copyright (C) 2001 Christian Hohnstaedt.
  64.  *
  65.  *  All rights reserved.
  66.  *
  67.  *
  68.  *  Redistribution and use in source and binary forms, with or without 
  69.  *  modification, are permitted provided that the following conditions are met:
  70.  *
  71.  *  - Redistributions of source code must retain the above copyright notice,
  72.  *    this list of conditions and the following disclaimer.
  73.  *  - Redistributions in binary form must reproduce the above copyright notice,
  74.  *    this list of conditions and the following disclaimer in the documentation
  75.  *    and/or other materials provided with the distribution.
  76.  *  - Neither the name of the author nor the names of its contributors may be 
  77.  *    used to endorse or promote products derived from this software without
  78.  *    specific prior written permission.
  79.  *
  80.  *
  81.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  82.  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  83.  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  84.  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  85.  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  86.  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  87.  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  88.  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  89.  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  90.  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  91.  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  92.  *
  93.  *
  94.  * This program links to software with different licenses from:
  95.  *
  96.  * http://www.openssl.org which includes cryptographic software
  97.  *  written by Eric Young (eay@cryptsoft.com)"
  98.  *
  99.  * http://www.sleepycat.com
  100.  *
  101.  * http://www.trolltech.com
  102.  * 
  103.  *
  104.  *
  105.  * http://www.hohnstaedt.de/xca
  106.  * email: christian@hohnstaedt.de
  107.  *
  108.  */                           
  109. </verb></tscreen>
  110. <sect1>Credits
  111. <p>
  112. In this version I have the pleasure of acknowledging
  113. <tscreen><verb>
  114. Kerstin Steinhauff &lt;tine (at) kerstine.de&gt;
  115.         Arts, graphics, testing, SuSE rpm building
  116. Ilya Kozhevnikov &lt;ilya (at) ef.unn.ru&gt;
  117.         Compiling and testing the WIN32-port
  118. </verb></tscreen>
  119. Thank you very much.
  120. <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  121. <sect>Common actions
  122. <p>
  123. Many actions are common to all crypto parts.
  124. <sect1>Importing items
  125. <p>
  126. The import of an item can be done by either clicking the import button on the right
  127. or via the context menu available by right clicking on the list background.
  128. The import function is smart enough to probe all known formats as there are:
  129. <itemize>
  130. <item><em>Keys:</em>  PEM private key, PEM public key, DER private key, DER public key, PKCS8 private key.
  131. <item><em>Requests</em> DER request, PEM request.
  132. <item><em>Certificates</em> DER certificate, PEM certificate (PKCS#12 and in future PKCS#7 certificates
  133. must be imported with an extra button, because they can contain more than one certificate)
  134. </itemize>
  135. After selecting the filename XCA will probe for the known formats of that item
  136. and in case of an error it prompts the <em>last</em> OpenSSL error message.
  137. <p>
  138. After reading the item it searches for this item in the database and if it is unique the item
  139. is stored in the database, otherwise it shows a message containing the internal name of the item
  140. in the database.
  141. <sect1>Details of an item
  142. <p>
  143. The details dialog can be accessed by double clicking the item, by the context menu or by
  144. the button on the right.
  145. The details dialog shows the internal name of the item, 
  146. which can be changed here and will be accepted when clicking <tt>Ok</tt>.
  147. the keysize and the modulus which is effectively the public part of the key and showing it to others is no security risk.
  148. The private part is not shown, only the availibility is mentioned.
  149. <sect1>Renaming an item
  150. <p>
  151. The Key can also be renamed via the context menu by right-clicking on the item
  152. or by the <tt>Rename</tt> button on the right border.
  153. If the new name of the item already exists in the database a <em>_01</em> will be appended to keep
  154. the internal name unique.
  155. <sect1>Deleting Items
  156. <p>
  157. Items can be deleted by the button on the right or via the context menu.
  158. <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  159. <sect>The Wizard <label id="wizard">
  160. <p>
  161. The Wizard is the central part for collecting all data regarding Certificates,
  162. Requests and Templates. It will be invoked for generating Requests, Certificates
  163. and Templates and for changing Templates.
  164. <sect1>Template selection
  165. <p>
  166. On this page the template to be used can be selected. All following pages will be 
  167. preset to the appropriate values of the selected template. If you don't want to 
  168. use a template just select the <tt>Empty Template</tt>.
  169. If the checkbox labeled: <tt>Change the default extensions of the template</tt>
  170. is checked the Wizard will show 3 more pages containing all certificate extensions.
  171. The lazy people leave this checkbox unchecked.
  172. <p>
  173. For generating Certificates there is a drop-down list of all Requests that are available. 
  174. If you don't want to sign a request but generate a certificate from scratch
  175. or template, uncheck the checkbox to the left of the request list.
  176. Also only for creating certificates the signer of the new certificate
  177. can be selected wether it shall become a <em>self-signed</em> certificate
  178. or get signed by one of the <ref id="ca_cert" name="CA certificates"> in the 
  179. drop-down list.
  180. <p>
  181. This page is not shown when creating or changing templates.
  182. <sect1>Personal settings
  183. <p>
  184. On this Page all personal data like country, name and Email address
  185. can be filled in. Only the <tt>Internal name</tt> is mandatory.
  186. The <tt>Country code</tt> field must either be empty or exactly contain
  187. two letters representing your country code; e.g. <em>DE</em> for Germany.
  188. If you want to create a SSL-server certificate the <tt>Common name</tt>
  189. must contain the <em>DNS</em> name of the server.
  190. <p>
  191. Keys can be generated here <em>on the fly</em> by pressing the button.
  192. The newly generated key will be stored in the database, 
  193. even if you cancel the Wizard. The drop-down list of the keys
  194. does only contain keys that were not used by an other certificate or
  195. request. The Keylist is not available for creating or changing templates.
  196. <p>
  197. This page does not appear when signing a request, because the request does
  198. contain all needed data from this page.
  199. <sect1>X509v3 Extensions
  200. <p>
  201. The following 3 pages do contain all fields for adjusting the certificate extensions.
  202. It is not in the focus of this document to explain them in detail.
  203. The most important are the <tt>Basic Constraints</tt> and the <tt>Validity</tt> range.
  204. <p>
  205. For more information consult the documents in <ref id="otherdoc">.
  206. Expecially if you don't know what this is all about consider not to create any
  207. certificates before reading those documents.
  208. <sect2>Basic Constraints
  209. <p>
  210. If the <tt>CA</tt> flag is set to true the certificate is recognized by XCA and other
  211. instances as issuer for other certificates. Server-certificates or E-Mail certificates
  212. must have set this flag to <tt>false</tt>
  213. <sect2>Validity Range
  214. <p>
  215. The <em>not Before</em> field is set to the current date and time of the
  216. operating system and the <em>not After</em> field is set to the current date and time
  217. plus the specified time range.
  218. <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  219. <sect>RSA Keys <label id="keys">
  220. <p>
  221. For asynchronous encryption and signing there are keys needed. XCA only supports RSA keys
  222. and no DSA keys. All keys are stored encrypted in the database using the 3DES algorithm.
  223. <p>
  224. All keys do carry a use counter which counts the times it is used. For new
  225. requests or certificates the list of available keys is reduced to
  226. the keys with a use counter of 0.
  227. <sect1>Generating Keys
  228. <p>
  229. The dialog asks for the internal name of the key and the keysize in bits.
  230. While searching for random prime numbers a progress bar is shown. Although the
  231. Progressbar carries a <tt>Cancel</tt> button it has no effect clicking on it
  232. since the underlaying <em>OpenSSL</em> routine does not support an abort.
  233. So think twice before generating a 4096 bit key on a 80Mhz i486 PC ....
  234. After the key generation is done the key will be stored in the database.
  235. <sect1>Key export
  236. <p>
  237. Keys can be exported by either selecting the key and pressing <em>Export</em> or by
  238. using the context-menu. This opens a Dialogbox where you can change the following settings:
  239. <itemize>
  240. <item>filename
  241. <item>Outputformat (DER, PEM, PKCS#8)
  242. <item>Public or Private Key
  243. <item>Encryption of the exported file (yes/no)
  244. </itemize>
  245. The filename is the internal name plus a <tt>pem</tt> suffix.
  246. If the desired fileformat is not PEM it is your responsibility
  247. to change the suffix to <tt>der</tt> or <tt>pk8</tt>.
  248. Only PKCS&num;8 or PEM files can be encrypted, because
  249. the DER format (although it could be encrypted)
  250. does not support a way to supply the encryption algorithm
  251. like e.g. <em>DES</em>.
  252. Of course the encryption is senseless if the private part is not exported.
  253. <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  254. <sect>Certificate Signing Requests <label id="csr">
  255. <p>
  256. Certificate signing requests are described in PKCS#10 standard.
  257. They are used to supply a Certification Authority with the 
  258. needed information to issue a valid certificate for you 
  259. without knowing your private key. This
  260. includes your personal information and your public key.
  261. <sect1>Generating a new Request
  262. <p>
  263. After clicking on the <tt>New Request</tt> button the Certificate Wizard will be started to ask
  264. all needed information for generating a new Request. See: <ref id="wizard" name="Wizard">
  265. The request generation can also be invoked by the context menu of a certificate (Export->Request).
  266. This menu point is only available if the private key of the certificate is available.
  267. In this case all needed data is copied from the certificate and the Wizard is not invoked.
  268. <sect1>Request export
  269. <p>
  270. Requests can be exported by either the context-menu or by selecting the request and pressing
  271. the <tt>Export</tt> button.
  272. The only supported format for exported requests is PEM, because there is no need for 
  273. DER formatted requests in real life. If someone needs DER formatted requests, drop me
  274. a mail and I will implement it.
  275. <sect1>Request details
  276. <p>
  277. All information contained in the request are shown. If the Keystore does contain
  278. the private key corresponding to the request the keys internal name is shown in the
  279. <tt>Key</tt> field.
  280. <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  281. <sect>Certificates
  282. <p>
  283. All Certificates from the database are displayed in a tree view reflecting the chain dependencies.
  284. If there is a CA certificate and several client certificates signed by this CA,
  285. the client certificates can be shown by clicking on the plus sign of the CA certificate.
  286. <sect1>CA certificates <label id="ca_cert">
  287. <p>
  288. XCA recognizes your CA certificates if the CA flag in the <em>Basic Constraints</em> is set to true
  289. and if there is a corresponding private key.
  290. In this case the <tt>CA</tt> submenu in the context-menu is enabled.
  291. <p>
  292. For building the chains the CA flag is disregarded instead it consideres the issuer name and
  293. the signature to decide which certificate is the issuer.
  294. <sect1>Generating certificates
  295. <p>
  296. After clicking on the <tt>New Certificate</tt> button the Certificate Wizard will be started to ask
  297. all needed information for generating a new Request. See: <ref id="wizard" name="Wizard">
  298. Certificate creation can also be invoked by the context menu of the certificate list background
  299. or by the context menu of the request.
  300. In this case the Wizard is preset with the Request to be signedi.
  301. <p>
  302. If in the certificate list a <em>CA certificate</em> is selected, this
  303. certificate is preselected as signer certificate on the second page of the Wizard.
  304. <sect1>Certificate details
  305. <p>
  306. The signer is the internal name of the issuers certificate, <em>SELF SIGNED</em> if it is
  307. self signed or <em>SIGNER UNKNOWN</em> if the issuers certificate is not available.
  308. The validity is set to <em>valid</em> if the certificate dates are valid
  309. or to <em>Not valid</em> if the are not, regarding the internal time and date of the OS.
  310. <p>
  311. If the certificate was revoked, the revocation date is shown instead.
  312. <sect1>Certificate trustment
  313. <p>
  314. The certificate trustment can be changed by the context menu of the certificate.
  315. It can be set to:
  316. <itemize>
  317. <item><bf>Not trusted</bf> - never trust this certificate, even if we trust the issuer. 
  318. This is the default for imported self-signed certificates.
  319. <item><bf>Trust depends on issuer</bf> - only trust this certificate, if we trust the
  320. issuer. This is the default for imported and generated non-self-signed certificates.
  321. <item><bf>Always trust</bf> - always trust this certificate, even if we do not trust
  322. the issuers certificate or if it is absent. This is the default for generated 
  323. self-signed certificates.
  324. </itemize>
  325. <sect1>Certificate export
  326. <p>
  327. The filename can be selected in the export dialog and the Export format:
  328. <itemize>
  329. <item><bf>PEM</bf> - PEM encoded
  330. <item><bf>PEM with Certificate chain</bf> - PEM encoded certificate and all issuers up to the
  331. root certificate in one file
  332. <item><bf>PEM all trusted Certificates</bf> - List of all PEM encoded certificates
  333. that are marked als <em>Always trusted</em> (usually all self-signed certificates)
  334. in one file for e.g. apache as trusted cert store.
  335. <item><bf>PEM all Certificates</bf> - All PEM encoded certificates in one file.
  336. <item><bf>DER</bf> - DER encoded certificate.
  337. <item><bf>Signed PKCS#7</bf> - PEM encoded PKCS#7 structure signed by the issuer.
  338. <item><bf>PKCS#12</bf> - PKCS#12 structure containing the certificate and the corresponding 
  339. <item><bf>PKCS#12</bf> - PKCS#12 structure containing the certificate, the corresponding 
  340. private key and the chain of all issuers certificates.
  341. </itemize>
  342. <p>
  343. The PKCS#12 structures will be encrypted by the password you are asked for later.
  344. <sect1>Certificate revokation
  345. <p>
  346. Certificates only can be revoked, if the private key of the issuers certificate
  347. is available. The certificate will marked as revoked and the revokation date
  348. will be stored with the certificate.
  349. <sect1>Certificate renewal
  350. <p>
  351. Certificates only can be renewed, if the private key of the issuers certificate
  352. is available. Renewal is done by creating a new certificate as a copy of the original one
  353. with just adjusted validity dates.
  354. <sect1>PKCS#7
  355. <p>
  356. PKCS#7 structures can be created by the context menu of the signing certificate.
  357. The PKCS#7 structure can be either signed or encrypted. 
  358. Therefore it will prompt for a file to be either signed or encrypted.
  359. The resulting file has the original filename with ".p7s" suffix.
  360. <sect1>CA special functions
  361. <p>
  362. The context menu of CA certificates does contain the <em>CA</em> submenu.
  363. that makes the following functions available:
  364. <itemize>
  365. <item><bf>Serial</bf> The serial number of the next certificate
  366. signed by this issuer.
  367. <item><bf>CRL days</bf> The days until the next CRL release.
  368. <item><bf>Signing Template</bf> The default template for signing certificates.
  369. <item><bf>Generate CRL</bf> Generate the CRL by collecting all revoked certificates
  370. and their revokation date.
  371. </itemize>
  372. <!-- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -->
  373. </article>