<chapter id="ikeref-1"><title>Internet Key Exchange (Reference)</title><highlights><para>This chapter contains the following reference information about IKE:</para><itemizedlist><listitem><para><olink targetptr="ike-17" remap="internal">IKE Daemon</olink></para>
</listitem><listitem><para><olink targetptr="ike-6" remap="internal">IKE Policy File</olink></para>
</listitem><listitem><para><olink targetptr="ike-19" remap="internal">IKE Administration Command</olink></para>
</listitem><listitem><para><olink targetptr="ike-15" remap="internal">IKE Preshared Keys Files</olink></para>
</listitem><listitem><para><olink targetptr="ike-20" remap="internal">IKE Public Key Databases and Commands</olink></para>
</listitem>
</itemizedlist><para>For instructions on implementing IKE, see <olink targetptr="ike-task-1" remap="internal">Chapter&nbsp;23, Configuring IKE (Tasks)</olink>. For
overview information, see <olink targetptr="ike-1" remap="internal">Chapter&nbsp;22, Internet Key Exchange (Overview)</olink>.</para>
</highlights><sect1 id="ike-17"><title>IKE Daemon</title><para>The <command>in.iked</command> daemon automates the management
of cryptographic keys for IPsec on a Solaris system. The daemon negotiates
with a remote system that is running the same protocol to provide authenticated
keying materials for security associations (SAs) in a protected manner. The
daemon must be running on all systems that plan to communicate securely.</para><para>The IKE daemon is automatically loaded at boot time if the configuration
file for the IKE policy, <filename>/etc/inet/ike/config</filename>, exists.
The daemon checks the syntax of the configuration file.</para><para>When the IKE daemon runs, the system authenticates itself to its peer
IKE entity in the Phase 1 exchange. The peer is defined in the IKE policy
file, as are the authentication methods. The daemon then establishes the keys
for the Phase 2 exchange. At an interval specified in the policy file, the
IKE keys are refreshed automatically. The <command>in.iked</command> daemon
listens for incoming IKE requests from the network and for requests for outbound
traffic through the <literal>PF_KEY</literal> socket. For more information,
see the <olink targetdoc="refman7" targetptr="pf-key-7p" remap="external"><citerefentry><refentrytitle>pf_key</refentrytitle><manvolnum>7P</manvolnum></citerefentry></olink> man
page.</para><para>Two commands support the IKE daemon. The <command>ikeadm</command> command
enables you to view and modify the IKE policy. The <command>ikecert</command> command
enables you to view and manage the public key databases. This command manages
the local databases, <filename>ike.privatekeys</filename> and <filename>publickeys</filename>. This command also manages public key operations and the storage
of public keys on hardware.</para>
</sect1><sect1 id="ike-6"><title>IKE Policy File</title><para>The configuration file for the IKE policy, <filename>/etc/inet/ike/config</filename>, manages the keys for the interfaces that are being protected
in the IPsec policy file, <filename>/etc/inet/ipsecinit.conf</filename>. The
IKE policy file manages keys for IKE, and for the IPsec SAs. The IKE daemon
itself requires keying material in the Phase 1 exchange.</para><para>Key management with IKE includes rules and global parameters. An IKE
rule identifies the systems or networks that the keying material secures.
The rule also specifies the authentication method. Global parameters include
such items as the path to an attached hardware accelerator. For examples of
IKE policy files, see <olink targetptr="ike-task-13" remap="internal">Configuring IKE With
Preshared Keys (Task Map)</olink>. For examples and descriptions of IKE policy
entries, see the <olink targetdoc="refman4" targetptr="ike.config-4" remap="external"><citerefentry><refentrytitle>ike.config</refentrytitle><manvolnum>4</manvolnum></citerefentry></olink> man
page.</para><para>The IPsec SAs that IKE supports protect the IP datagrams according to
policies that are set up in the configuration file for the IPsec policy, <filename>/etc/inet/ipsecinit.conf</filename>. The IKE policy file determines if perfect
forward security (PFS) is used when creating the IPsec SAs.</para><para>The <filename>ike/config</filename> file can include the path to a library
that is implemented according to the following standard: RSA Security Inc.
PKCS&nbsp;#11 Cryptographic Token Interface (Cryptoki). IKE uses this PKCS&nbsp;#11
library to access hardware for key acceleration and key storage.</para><para>The security considerations for the <filename>ike/config</filename> file
are similar to the considerations for the <filename>ipsecinit.conf</filename> file.
For details, see <olink targetptr="ipsecref-42" remap="internal">Security Considerations for
ipsecinit.conf and ipsecconf</olink>.</para>
</sect1><sect1 id="ike-19"><title>IKE Administration Command</title><para>You can use the <command>ikeadm</command> command to do the following:</para><itemizedlist><listitem><para>View aspects of the IKE daemon process.</para>
</listitem><listitem><para>Change the parameters that are passed to the IKE daemon.</para>
</listitem><listitem><para>Display statistics on SA creation during the Phase 1 exchange.</para>
</listitem><listitem><para>Debug IKE processes.</para>
</listitem>
</itemizedlist><para>For examples and a full description of this command's options, see the <olink targetdoc="refman1m" targetptr="ikeadm-1m" remap="external"><citerefentry><refentrytitle>ikeadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page. The privilege level of the running IKE daemon determines which aspects
of the IKE daemon can be viewed and  modified. You can choose from three levels
of privilege.</para><variablelist><varlistentry><term><literal>0x0</literal>, or base level</term><listitem><para>You cannot view nor modify keying material. The base level
is the default level at which the <command>in.iked</command> daemon runs.</para>
</listitem>
</varlistentry><varlistentry><term><literal>0x1</literal>, or modkeys level</term><listitem><para>You can remove, change, and add preshared keys.</para>
</listitem>
</varlistentry><varlistentry><term><literal>0x2</literal>, or keymat level</term><listitem><para>You can view the actual keying material with the <command>ikeadm</command> command.</para>
</listitem>
</varlistentry>
</variablelist><para>The security considerations for the <command>ikeadm</command> command
are similar to the considerations for the <command>ipseckey</command> command.
For details, see <olink targetptr="ipsecref-41" remap="internal">Security Considerations for
ipseckey</olink>.</para>
</sect1><sect1 id="ike-15"><title>IKE Preshared Keys Files</title><para>When you create preshared keys manually, the keys are stored in
files in the <filename class="directory">/etc/inet/secret</filename> directory.
The <filename>ike.preshared</filename> file contains the preshared keys for
Internet Security Association and Key Management Protocol (ISAKMP) SAs. The <filename>ipseckeys</filename> file contains the preshared keys for IPsec SAs. The files
are protected at <literal>0600</literal>. The <filename class="directory">secret</filename> directory
is protected at <literal>0700</literal>.</para><itemizedlist><listitem><para>You create an <filename>ike.preshared</filename> file when
you configure the <filename>ike/config</filename> file to require preshared
keys. You enter keying material for ISAKMP SAs, that is, for IKE authentication,
in the <filename>ike.preshared</filename> file. Because the preshared keys
are used to authenticate the Phase 1 exchange, the file must be valid before
the <command>in.iked</command> daemon starts.</para>
</listitem><listitem><para>The <filename>ipseckeys</filename> file contains keying material
for IPsec SAs. For examples of manually managing the file, see <olink targetptr="ipsec-mgtasks-13" remap="internal">How to Manually Create IPsec Security Associations</olink>.
The IKE daemon does not use this file. The keying material that IKE generates
for IPsec SAs is stored in the kernel.</para>
</listitem>
</itemizedlist><note><para>Preshared keys cannot take advantage of hardware storage. Preshared
keys are generated and are stored on the system.</para>
</note>
</sect1><sect1 id="ike-20"><title>IKE Public Key Databases and Commands</title><para>The <command>ikecert</command> command manipulates the local system's
public key databases. You use this command when the <filename>ike/config</filename> file
requires public key certificates. Because IKE uses these databases to authenticate
the Phase 1 exchange, the databases must be populated before activating the <command>in.iked</command> daemon. Three subcommands handle each of the three databases: <command>certlocal</command>, <command>certdb</command>, and <command>certrldb</command>.</para><para>The <command>ikecert</command> command also handles key storage.
Keys can be stored on disk, on an attached Sun Crypto Accelerator 4000 board, or in a softtoken
keystore. The softtoken keystore is available when the metaslot in the Solaris
cryptographic framework is used to communicate with the hardware device. The <command>ikecert</command> command uses the PKCS&nbsp;#11 library to locate key storage.</para><itemizedlist><listitem><para><emphasis role="strong">Solaris 10 1/06</emphasis>: In this
release, the library does not have to be specified. By default, the PKCS&nbsp;#11
library is <filename>/usr/lib/libpkcs11.so</filename>.</para>
</listitem><listitem><para><emphasis role="strong">Solaris 10</emphasis>: In this release,
the PKCS&nbsp;#11 entry must be specified. Otherwise, the <option>T</option> option
to the <command>ikecert</command> command cannot work. The entry appears similar
to the following:</para><screen>pkcs11_path <userinput>"/opt/SUNWconn/cryptov2/lib/libvpkcs11.so"</userinput></screen>
</listitem>
</itemizedlist><para>For more information, see the <olink targetdoc="refman1m" targetptr="ikecert-1m" remap="external"><citerefentry><refentrytitle>ikecert</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page. For
information about metaslot and the softtoken keystore, see the <olink targetdoc="refman1m" targetptr="cryptoadm-1m" remap="external"><citerefentry><refentrytitle>cryptoadm</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man
page.</para><sect2 id="ike-25"><title><command>ikecert tokens</command> Command</title><para>The <literal>tokens</literal> argument lists the token IDs that
are available. Token IDs enable the <command>ikecert certlocal</command> and <command>ikecert certdb</command> commands to generate public key certificates and
certificate requests. The certificates and certificate requests can also be
stored by the cryptographic framework in the softtoken
keystore, or on an attached Sun Crypto Accelerator 4000 board. The <command>ikecert</command> command
uses the PKCS&nbsp;#11 library to locate certificate storage.</para>
</sect2><sect2 id="ike-27"><title><command>ikecert certlocal</command> Command</title><para>The <literal>certlocal</literal> subcommand manages the private
key database. Options to this subcommand enable you to add, view, and remove
private keys. This subcommand also creates either a self-signed certificate
or a certificate request. The <option>ks</option> option creates a self-signed
certificate. The <option>kc</option> option creates a certificate request.
Keys are stored on the system in the <filename class="directory">/etc/inet/secret/ike.privatekeys</filename> directory, or on attached hardware with the <option>T</option> option.</para><para>When you create a private key, the options to the <command>ikecert
certlocal</command> command must have related entries in the <filename>ike/config</filename> file. The correspondences between <command>ikecert</command> options
and <filename>ike/config</filename> entries are shown in the following
table.</para><table frame="topbot" pgwide="1" id="ike-tbl-1"><title>Correspondences Between <command>ikecert</command> Options and <filename>ike/config</filename> Entries</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec2" colwidth="24.80*"/><colspec colname="colspec3" colwidth="28.80*"/><colspec colname="colspec4" colwidth="45.41*"/><thead><row rowsep="1"><entry rowsep="1"><para><command>ikecert</command> Option</para>
</entry><entry rowsep="1"><para><filename>ike/config</filename> Entry</para>
</entry><entry rowsep="1"><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry rowsep="1"><para><option>A</option> <replaceable>subject-alternate-name</replaceable></para>
</entry><entry rowsep="1"><para><literal>cert_trust</literal> <replaceable>subject-alternate-name</replaceable></para>
</entry><entry rowsep="1"><para>A nickname that uniquely identifies the certificate. Possible values
are an IP address, an email address, or a domain name.</para>
</entry>
</row><row><entry rowsep="1"><para><option>D</option> <replaceable>X.509-distinguished-name</replaceable></para>
</entry><entry rowsep="1"><para><replaceable>X.509-distinguished-name</replaceable></para>
</entry><entry rowsep="1"><para>The full name of the certificate authority that includes the country
(C), organization name (ON), organizational unit (OU), and common name (CN).</para>
</entry>
</row><row><entry rowsep="1"><para><option>t dsa-sha1</option></para>
</entry><entry rowsep="1"><para><literal>auth_method dss_sig</literal></para>
</entry><entry rowsep="1"><para>An authentication method that is slightly slower than <olink targetptr="glossary-59" remap="internal">RSA</olink>.</para>
</entry>
</row><row><entry rowsep="1"><para><option>t rsa-md5</option> and</para><para><option>t rsa-sha1</option></para>
</entry><entry rowsep="1"><para><literal>auth_method rsa_sig</literal></para>
</entry><entry rowsep="1"><para>An authentication method that is slightly faster than <olink targetptr="glossary-45" remap="internal">DSA</olink>.</para><para>The RSA public key must be large enough to encrypt the biggest <olink targetptr="glossary-122" remap="internal">payload</olink>. Typically, an identity payload,
such as the X.509 distinguished name, is the biggest payload.</para>
</entry>
</row><row><entry rowsep="1"><para><option>t rsa-md5</option> and</para><para><option>t rsa-sha1</option></para>
</entry><entry rowsep="1"><para><literal>auth_method rsa_encrypt</literal></para>
</entry><entry rowsep="1"><para>RSA encryption hides identities in IKE from eavesdroppers, but requires
that the IKE peers know each other's public keys.</para>
</entry>
</row><row><entry rowsep="1"><para><option>T</option></para>
</entry><entry rowsep="1"><para><literal>pkcs11_path</literal></para>
</entry><entry rowsep="1"><para>The PKCS&nbsp;#11 library handles key acceleration on the Sun Crypto Accelerator 1000 board and
the Sun Crypto Accelerator 4000 board. The library also provides the tokens that handle key storage
on the Sun Crypto Accelerator 4000 board.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>If you issue a certificate request with the <command>ikecert certlocal
-kc</command> command, you send the output of the command to a PKI organization
or to a certificate authority (CA). If your company runs its own PKI, you
send the output to your PKI administrator. The PKI organization, the CA, or
your PKI administrator then creates certificates. The certificates that the
PKI or CA returns to you are input to the <command>certdb</command> subcommand.
The certificate revocation list (CRL) that the PKI returns to you is input
for the <command>certrldb</command> subcommand.</para>
</sect2><sect2 id="ike-18"><title><command>ikecert certdb</command> Command</title><para>The <literal>certdb</literal> subcommand manages the public key
database. Options to this subcommand enable you to add, view, and remove certificates
and public keys. The command accepts, as input, certificates that were generated
by the <command>ikecert certlocal -ks</command> command on a remote system.
For the procedure, see <olink targetptr="ike-task-42" remap="internal">How to Configure IKE
With Self-Signed Public Key Certificates</olink>. This command also accepts
the certificate that you receive from a PKI or CA as input.  For the procedure,
see <olink targetptr="ike-task-41" remap="internal">How to Configure IKE With Certificates
Signed by a CA</olink>.</para><para>The certificates and public keys are stored on the system in the <filename class="directory">/etc/inet/ike/publickeys</filename> directory. The <option>T</option> option
stores the certificates, private keys, and public keys on attached hardware.</para>
</sect2><sect2 id="ike-30"><title><command>ikecert certrldb</command> Command</title><para>The <literal>certrldb</literal> subcommand manages the certificate
revocation list (CRL) database, <filename class="directory">/etc/inet/ike/crls</filename>.
The CRL database maintains the revocation lists for public keys. Certificates
that are no longer valid are on this list. When PKIs provide you with a CRL,
you can install the CRL in the CRL database with the <command>ikecert certrldb</command> command.
 For the procedure, see <olink targetptr="ike-task-22" remap="internal">How to Handle a Certificate
Revocation List</olink>.</para>
</sect2><sect2 id="ike-21"><title><filename class="directory">/etc/inet/ike/publickeys</filename> Directory</title><para>The <filename class="directory">/etc/inet/ike/publickeys</filename> directory
contains the public part of a public-private key pair and its certificate
in files, or <emphasis>slots</emphasis>. The directory is protected at <literal>0755</literal>. The <command>ikecert certdb</command> command populates the directory.
The <option>T</option> option stores the keys on the Sun Crypto Accelerator 4000 board rather than
in the <filename class="directory">publickeys</filename> directory.</para><para>The slots contain, in encoded form, the X.509 distinguished name
of a certificate that was generated on another system. If you are using self-signed
certificates, you use the certificate that you receive from the administrator
of the remote system as input to the command. If you are using certificates
from a PKI, you install two pieces of keying material from the PKI into this
database. You install a certificate that is based on material that you sent
to the PKI. You also install a CA from the PKI.</para>
</sect2><sect2 id="ike-8"><title><filename class="directory">/etc/inet/secret/ike.privatekeys</filename> Directory</title><para>The <filename class="directory">/etc/inet/secret/ike.privatekeys</filename> directory
holds private key files that are part of a public-private key pair, which
is keying material for ISAKMP SAs. The directory is protected at <literal>0700</literal>.
The <command>ikecert certlocal</command> command populates the <filename class="directory">ike.privatekeys</filename> directory. Private keys are not
effective until their public key counterparts, self-signed certificates or
CAs, are installed. The public key counterparts are stored in the <filename class="directory">/etc/inet/ike/publickeys</filename> directory or on a Sun Crypto Accelerator 4000 board.</para>
</sect2><sect2 id="ike-16"><title><filename class="directory">/etc/inet/ike/crls</filename> Directory</title><para>The <filename class="directory">/etc/inet/ike/crls</filename> directory
contains certificate revocation list (CRL) files. Each file corresponds to
a public certificate file in the <filename class="directory">/etc/inet/ike/publickeys</filename> directory. PKI organizations provide the CRLs for their certificates.
You can use the <command>ikecert certrldb</command> command to populate the
database.</para>
</sect2>
</sect1>
</chapter>