| 1 |
<?xml version='1.0'?> <!--*-nxml-*--> |
| 2 |
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
| 3 |
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="systemd-keyutil" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
<refentryinfo> |
| 9 |
<title>systemd-keyutil</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>systemd-keyutil</refentrytitle> |
| 15 |
<manvolnum>1</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>systemd-keyutil</refname> |
| 20 |
<refpurpose>Perform various operations on private keys and X.509 certificates</refpurpose> |
| 21 |
</refnamediv> |
| 22 |
|
| 23 |
<refsynopsisdiv> |
| 24 |
<cmdsynopsis> |
| 25 |
<command>systemd-keyutil</command> |
| 26 |
<arg choice="opt" rep="repeat">OPTIONS</arg> |
| 27 |
<arg choice="req">COMMAND</arg> |
| 28 |
</cmdsynopsis> |
| 29 |
</refsynopsisdiv> |
| 30 |
|
| 31 |
<refsect1> |
| 32 |
<title>Description</title> |
| 33 |
|
| 34 |
<para><command>systemd-keyutil</command> can be used to perform various operations on private keys and |
| 35 |
X.509 certificates.</para> |
| 36 |
</refsect1> |
| 37 |
|
| 38 |
<refsect1> |
| 39 |
<title>Commands</title> |
| 40 |
|
| 41 |
<variablelist> |
| 42 |
<varlistentry> |
| 43 |
<term><option>validate</option></term> |
| 44 |
|
| 45 |
<listitem><para>Checks that we can load the private key and certificate specified with |
| 46 |
<option>--private-key=</option> and <option>--certificate=</option> respectively.</para> |
| 47 |
|
| 48 |
<para>As a side effect, if the private key is loaded from a PIN-protected hardware token, this |
| 49 |
command can be used to cache the PIN in the kernel keyring. The |
| 50 |
<varname>$SYSTEMD_ASK_PASSWORD_KEYRING_TIMEOUT_SEC</varname> and |
| 51 |
<varname>$SYSTEMD_ASK_PASSWORD_KEYRING_TYPE</varname> environment variables can be used to control |
| 52 |
how long and in which kernel keyring the PIN is cached.</para> |
| 53 |
|
| 54 |
<xi:include href="version-info.xml" xpointer="v257"/> |
| 55 |
</listitem> |
| 56 |
</varlistentry> |
| 57 |
|
| 58 |
<varlistentry> |
| 59 |
<term><command>extract-public</command></term> |
| 60 |
|
| 61 |
<listitem><para>This commands prints the public key in PEM format extracted from either the |
| 62 |
certificate given with <option>--certificate=</option> or the private key given with |
| 63 |
<option>--private-key=</option>.</para> |
| 64 |
|
| 65 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 66 |
</varlistentry> |
| 67 |
|
| 68 |
<varlistentry> |
| 69 |
<term><command>extract-certificate</command></term> |
| 70 |
|
| 71 |
<listitem><para>This command prints the X.509 certificate in PEM format extracted from the |
| 72 |
certificate given with <option>--certificate=</option>. This is useful when loading a certificate |
| 73 |
from an OpenSSL provider (e.g. a hardware token) and wanting to output a standalone PEM certificate |
| 74 |
that can be used without the provider.</para> |
| 75 |
|
| 76 |
<xi:include href="version-info.xml" xpointer="v260"/></listitem> |
| 77 |
</varlistentry> |
| 78 |
|
| 79 |
<varlistentry> |
| 80 |
<term><command>pkcs7</command></term> |
| 81 |
|
| 82 |
<listitem><para>This command embeds the PKCS#1 signature (RSA) provided with |
| 83 |
<option>--signature=</option> in a PKCS#7 signature using the certificate given with |
| 84 |
<option>--certificate=</option> and writes it to the file specified with <option>--output=</option> |
| 85 |
in PKCS#7 format (p7s). If <option>--content=</option> is provided it is included in the p7s, |
| 86 |
otherwise a "detached" signature is created. The <option>--hash-algorithm=</option> option, which |
| 87 |
defaults to <literal>SHA256</literal>, specifies what hash algorithm was used to generate the |
| 88 |
signature.</para> |
| 89 |
|
| 90 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 91 |
</varlistentry> |
| 92 |
</variablelist> |
| 93 |
</refsect1> |
| 94 |
|
| 95 |
<refsect1> |
| 96 |
<title>Options</title> |
| 97 |
<para>The following options are understood:</para> |
| 98 |
|
| 99 |
<variablelist> |
| 100 |
<varlistentry> |
| 101 |
<term><option>--private-key=<replaceable>PATH/URI</replaceable></option></term> |
| 102 |
<term><option>--private-key-source=<replaceable>TYPE</replaceable>[:<replaceable>NAME</replaceable>]</option></term> |
| 103 |
<term><option>--certificate=<replaceable>PATH</replaceable></option></term> |
| 104 |
<term><option>--certificate-source=<replaceable>TYPE</replaceable>[:<replaceable>NAME</replaceable>]</option></term> |
| 105 |
|
| 106 |
<listitem><para>Set the private key and certificate to use. The <option>--certificate=</option> |
| 107 |
option takes a path to a PEM encoded X.509 certificate or a URI that's passed to the OpenSSL provider |
| 108 |
configured with <option>--certificate-source</option>. The <option>--certificate-source</option> |
| 109 |
takes one of <literal>file</literal> or <literal>provider</literal>, with the latter being followed |
| 110 |
by a specific provider identifier, separated with a colon, e.g. <literal>provider:pkcs11</literal>. |
| 111 |
The <option>--private-key=</option> option can take a path or a URI that will be passed to the |
| 112 |
OpenSSL engine or provider, as specified by <option>--private-key-source=</option> as a |
| 113 |
<literal>type:name</literal> tuple, such as <literal>engine:pkcs11</literal>.</para> |
| 114 |
|
| 115 |
<xi:include href="version-info.xml" xpointer="v257"/></listitem> |
| 116 |
</varlistentry> |
| 117 |
|
| 118 |
<varlistentry> |
| 119 |
<term><option>--signature=<replaceable>PATH</replaceable></option></term> |
| 120 |
|
| 121 |
<listitem><para>Input PKCS#1 signature for the <command>pkcs7</command> command.</para> |
| 122 |
|
| 123 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 124 |
</varlistentry> |
| 125 |
|
| 126 |
<varlistentry> |
| 127 |
<term><option>--content=<replaceable>PATH</replaceable></option></term> |
| 128 |
|
| 129 |
<listitem><para>Input data that corresponds to the PKCS#1 signature for the <command>pkcs7</command> |
| 130 |
command, used for generating inline (i.e. non-"detached") PKCS#7 signatures.</para> |
| 131 |
|
| 132 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 133 |
</varlistentry> |
| 134 |
|
| 135 |
<varlistentry> |
| 136 |
<term><option>--hash-algorithm=<replaceable>ALGORITHM</replaceable></option></term> |
| 137 |
|
| 138 |
<listitem><para>Hash algorithm used to generate the PKCS#1 signature for the <command>pkcs7</command> |
| 139 |
command. This should be a valid openssl digest algorithm; use <literal>openssl list |
| 140 |
-digest-algorithms</literal> to see a list of valid algorithms on your system. Defaults to |
| 141 |
<literal>SHA256</literal>.</para> |
| 142 |
|
| 143 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 144 |
</varlistentry> |
| 145 |
|
| 146 |
<varlistentry> |
| 147 |
<term><option>--output=<replaceable>PATH</replaceable></option></term> |
| 148 |
|
| 149 |
<listitem><para>Output PKCS#7 signature for the <command>pkcs7</command> command.</para> |
| 150 |
|
| 151 |
<xi:include href="version-info.xml" xpointer="v258"/></listitem> |
| 152 |
</varlistentry> |
| 153 |
|
| 154 |
<xi:include href="standard-options.xml" xpointer="help"/> |
| 155 |
<xi:include href="standard-options.xml" xpointer="version"/> |
| 156 |
</variablelist> |
| 157 |
</refsect1> |
| 158 |
|
| 159 |
<refsect1> |
| 160 |
<title>See Also</title> |
| 161 |
<para><simplelist type="inline"> |
| 162 |
<member><citerefentry><refentrytitle>systemd-sbsign</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 163 |
<member><citerefentry><refentrytitle>systemd-measure</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 164 |
</simplelist></para> |
| 165 |
</refsect1> |
| 166 |
</refentry> |