Skip to content

Commit

Permalink
Document pkey gen params and addition of Curve25519 + Curve448 (#4281)
Browse files Browse the repository at this point in the history
  • Loading branch information
bukka authored Dec 15, 2024
1 parent 7d2dd02 commit 3b06ef4
Show file tree
Hide file tree
Showing 3 changed files with 517 additions and 60 deletions.
122 changes: 85 additions & 37 deletions reference/openssl/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,52 +138,100 @@

<section xml:id="openssl.key-types">
<title>Key types</title>
<variablelist>
<varlistentry xml:id="constant.openssl-keytype-rsa">
<term>
<constant>OPENSSL_KEYTYPE_RSA</constant>
(<type>int</type>)
</term>
<listitem>
<variablelist>
<varlistentry xml:id="constant.openssl-keytype-rsa">
<term>
<constant>OPENSSL_KEYTYPE_RSA</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

RSA key type.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-dsa">
<term>
<constant>OPENSSL_KEYTYPE_DSA</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-dsa">
<term>
<constant>OPENSSL_KEYTYPE_DSA</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
DSA key type.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-dh">
<term>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-dh">
<term>
<constant>OPENSSL_KEYTYPE_DH</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>

</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-ec">
<term>
<constant>OPENSSL_KEYTYPE_EC</constant>
(<type>int</type>)
</term>
</term>
<listitem>
<simpara>
This constant is only available when PHP is compiled with OpenSSL 0.9.8+.
DH (Diffie-Hellman) key type.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-ec">
<term>
<constant>OPENSSL_KEYTYPE_EC</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Elliptic curve key type.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-x25519">
<term>
<constant>OPENSSL_KEYTYPE_X25519</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
X25519 curve key type.
This constant is only available when PHP is compiled with OpenSSL 3.0+.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-ed25519">
<term>
<constant>OPENSSL_KEYTYPE_ED25519</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Ed25519 curve key type.
This constant is only available when PHP is compiled with OpenSSL 3.0+.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-x448">
<term>
<constant>OPENSSL_KEYTYPE_X448</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
X448 curve key type.
This constant is only available when PHP is compiled with OpenSSL 3.0+.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.openssl-keytype-ed448">
<term>
<constant>OPENSSL_KEYTYPE_ED448</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Ed448 curve key type.
This constant is only available when PHP is compiled with OpenSSL 3.0+.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>

<section xml:id="openssl.pkcs7.flags">
Expand Down
47 changes: 28 additions & 19 deletions reference/openssl/functions/openssl-pkey-get-details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
<constant>OPENSSL_KEYTYPE_RSA</constant>,
<constant>OPENSSL_KEYTYPE_DSA</constant>,
<constant>OPENSSL_KEYTYPE_DH</constant>,
<constant>OPENSSL_KEYTYPE_EC</constant> or -1 meaning unknown).
<constant>OPENSSL_KEYTYPE_EC</constant>,
<constant>OPENSSL_KEYTYPE_X25519</constant>,
<constant>OPENSSL_KEYTYPE_ED25519</constant>,
<constant>OPENSSL_KEYTYPE_X448</constant>,
<constant>OPENSSL_KEYTYPE_ED448</constant>,
or <literal>-1</literal> meaning unknown).
</para>
<para>
Depending on the key type used, additional details may be returned. Note that
Expand Down Expand Up @@ -174,8 +179,16 @@
</listitem>
<listitem>
<simpara>
<constant>OPENSSL_KEYTYPE_EC</constant>, an additional array key named <literal>"ec"</literal>,
containing the key data is returned.
<constant>OPENSSL_KEYTYPE_X25519</constant>,
<constant>OPENSSL_KEYTYPE_ED25519</constant>,
<constant>OPENSSL_KEYTYPE_X448</constant>,
or <constant>OPENSSL_KEYTYPE_ED448</constant>
an additional array key named
<literal>"x25519"</literal>,
<literal>"ed25519"</literal>,
<literal>"x448"</literal>,
or <literal>"ed448"</literal> respectively,
is returned, containing the key data.
</simpara>
<informaltable>
<tgroup cols="2">
Expand All @@ -187,24 +200,12 @@
</thead>
<tbody>
<row>
<entry><literal>"curve_name"</literal></entry>
<entry>name of curve, see <function>openssl_get_curve_names</function></entry>
</row>
<row>
<entry><literal>"curve_oid"</literal></entry>
<entry>ASN1 Object identifier (OID) for EC curve.</entry>
</row>
<row>
<entry><literal>"x"</literal></entry>
<entry>x coordinate (public)</entry>
</row>
<row>
<entry><literal>"y"</literal></entry>
<entry>y coordinate (public)</entry>
<entry><literal>"priv_key"</literal></entry>
<entry>private key</entry>
</row>
<row>
<entry><literal>"d"</literal></entry>
<entry>private key</entry>
<entry><literal>"pub_key"</literal></entry>
<entry>public key</entry>
</row>
</tbody>
</tgroup>
Expand All @@ -224,6 +225,14 @@
</row>
</thead>
<tbody>
<row>
<entry>8.4.0</entry>
<entry>
Added support for Curve25519 and Curve448 based keys.
Specifically the <literal>x25519</literal>, <literal>ed25519</literal>,
<literal>x448</literal> and <literal>ed448</literal> fields have been introduced.
</entry>
</row>
<row>
<entry>8.0.0</entry>
<entry>
Expand Down
Loading

0 comments on commit 3b06ef4

Please sign in to comment.