Blame SOURCES/genkey.xml

4418f4
4418f4
4418f4
  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4418f4
4418f4
4418f4
4418f4
4418f4
]>
4418f4
4418f4
<refentry>
4418f4
4418f4
  <refentryinfo>
4418f4
    <date>&dat;;</date>
4418f4
    <title>Cryptography Utilities</title>
4418f4
    <productname>crypto-utils</productname>
4418f4
    <productnumber>&version;</productnumber>
4418f4
  </refentryinfo>
4418f4
4418f4
  <refmeta>
4418f4
    <refentrytitle>genkey</refentrytitle>
4418f4
    <manvolnum>1</manvolnum>
4418f4
  </refmeta>
4418f4
4418f4
  <refnamediv>
4418f4
    <refname>genkey</refname>
4418f4
    <refpurpose>generate SSL certificates and certificate requests</refpurpose>
4418f4
  </refnamediv>
4418f4
4418f4
  <refsynopsisdiv>
4418f4
    <cmdsynopsis>
4418f4
      <command>genkey</command>
4418f4
      <arg><option>--test</option></arg>
4418f4
      <arg><option>--days <replaceable>count</replaceable></option></arg>
4418f4
      <group>
4418f4
        <arg><option>--genreq</option></arg>
4418f4
        <arg><option>--makeca</option></arg>
4418f4
        <arg><option>--nss</option></arg>
4418f4
        <arg><option>--renew</option></arg>
4418f4
        <arg><option>--cacert</option></arg>
4418f4
      </group>
4418f4
      <arg choice="req"><replaceable>hostname</replaceable></arg>
4418f4
    </cmdsynopsis>
4418f4
  </refsynopsisdiv>
4418f4
4418f4
  <refsect1>
4418f4
    <title>Description</title>
4418f4
4418f4
    <para><command>genkey</command> is an interactive command-line
4418f4
    tool which can be used to generate SSL certificates or Certificate
4418f4
    Signing Requests (CSR).  Generated certificates are stored in the
4418f4
    directory <filename>/etc/pki/tls/certs/</filename>, and the
4418f4
    corresponding private key in
4418f4
    <filename>/etc/pki/tls/private/</filename>. </para>
4418f4
4418f4
    <para>When using mod_nss the private key is stored in the
4418f4
    nss database. Consult the nss.conf file in
4418f4
    <filename>/etc/httpd/conf.d/</filename>
4418f4
    for the location of the database. </para>
4418f4
4418f4
    <para><command>genkey</command> will prompt for the size of key
4418f4
    desired; whether or not to generate a CSR; whether or not an
4418f4
    encrypted private key is desired; the certificate subject DN
4418f4
    details.</para>
4418f4
4418f4
    <para><command>genkey</command> generates random data for the
4418f4
    private key using the truerand library and also by prompting the
4418f4
    user for entry of random text.</para>
4418f4
4418f4
    <para><option>nss</option> indicates that mod_nss database 
4418f4
    should be used to store keys and certificates.</para>
4418f4
4418f4
  </refsect1>
4418f4
  
4418f4
  <refsect1>
4418f4
    <title>Options</title>
4418f4
    
4418f4
    <variablelist>
4418f4
      <varlistentry>
4418f4
        <term><option>--makeca</option></term>
4418f4
        <listitem><simpara>Generate a Certificate Authority
4418f4
        keypair and certificate.</simpara></listitem>
4418f4
      </varlistentry>
4418f4
4418f4
      <varlistentry>
4418f4
        <term><option>--genreq</option></term>
4418f4
        <listitem><simpara>Generate a Certificate Signing Request for
4418f4
        an existing private key, which can be submitted to a CA (for
4418f4
        example, for renewal).</simpara></listitem>
4418f4
      </varlistentry>
4418f4
4418f4
4418f4
      <varlistentry>
4418f4
        <term><option>--renew</option></term>
4418f4
        <listitem><simpara>Used with --genreq to indicate a renewal,
4418f4
        the existing keypair will be used. Certs and keys must reside
4418f4
        in the nss database, therefore --nss is also required. Pem file
4418f4
        based cert renewal is not currently supported.</simpara></listitem>
4418f4
      </varlistentry>
4418f4
4418f4
      <varlistentry>
4418f4
        <term><option>--cacert</option></term>
4418f4
        <listitem><simpara>The certificate renewal is for a CA, needed for openssl certs only.</simpara></listitem>
4418f4
      </varlistentry>
4418f4
4418f4
      <varlistentry>
4418f4
        <term><option>--days</option> <replaceable>count</replaceable></term>
4418f4
        <listitem><simpara>When generating a self-signed certificate,
4418f4
        specify that the number of days for which the certificate is
4418f4
        valid be <replaceable>count</replaceable> rather than the default
4418f4
        value of 30.</simpara></listitem>
4418f4
      </varlistentry>
4418f4
4418f4
      <varlistentry>
4418f4
        <term><option>--test</option></term>
4418f4
        <listitem><simpara>For test purposes only; omit the slow
4418f4
        process of generating random data.</simpara></listitem>
4418f4
      </varlistentry>
4418f4
    </variablelist>
4418f4
  </refsect1>
4418f4
4418f4
  <refsect1>
4418f4
    <title>Examples</title>
4418f4
4418f4
    <para>The following example will create a self-signed certificate
4418f4
    and private key for the hostname
4418f4
    <literal>www.example.com</literal>:
4418f4
4418f4
      <programlisting>
4418f4
        # genkey --days 120 www.example.com
4418f4
      </programlisting>
4418f4
4418f4
    </para>
4418f4
4418f4
    <para>The following example will create a self-signed certificate
4418f4
    and private key for the hostname <literal>www.nssexample.com</literal>
4418f4
    which will be stored in cert and key in the nss database. If no nickname
4418f4
    is given the tool will extract it from mod_nss's nss configuration file.
4418f4
    
4418f4
      <programlisting>
4418f4
        # genkey --days --nss 120 www.nssexample.com
4418f4
      </programlisting>
4418f4
4418f4
    </para>
4418f4
4418f4
    <para>The following example will generate a certificate signing
4418f4
     request for a new mod_nss style cert specified by its nickname, 
4418f4
    <literal>Server-Cert</literal>:
4418f4
    
4418f4
      <programlisting>
4418f4
        # genkey --genreq --nss --days 120 Server-Cert
4418f4
      </programlisting>
4418f4
4418f4
    </para>
4418f4
4418f4
    <para>The following example will generate a certificate signing request
4418f4
    for the renewal of an existing mod_nss cert specified by its nickname, 
4418f4
    <literal>Server-Cert</literal>:
4418f4
    
4418f4
      <programlisting>
4418f4
        # genkey --genreq --renew --nss --days 120 Server-Cert
4418f4
      </programlisting>
4418f4
4418f4
    </para>
4418f4
   
4418f4
  </refsect1>    
4418f4
4418f4
  <refsect1>
4418f4
    <title>Files</title>
4418f4
4418f4
    <para><filename>/etc/pki/tls/openssl.cnf</filename></para>
4418f4
4418f4
  </refsect1>
4418f4
4418f4
  <refsect1>
4418f4
    <title>See also</title>
4418f4
4418f4
    <para>certwatch(1), keyrand(1)</para>
4418f4
  </refsect1>
4418f4
4418f4
</refentry>
4418f4
4418f4
4418f4
-->