Skip to content

Commit f978cf6

Browse files
authored
Merge pull request OpenSC#3090 from dengert/X25519-improvements-2
X25519 improvements 2 in PKCS11-tool, PKCS15 routines, tools, OpenPGP and PIV
2 parents b35f5af + 20bd9ef commit f978cf6

37 files changed

+2018
-1257
lines changed

doc/tools/pkcs11-tool.1.xml

+11-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
<option>--key-type</option> <replaceable>specification</replaceable>
148148
</term>
149149
<listitem><para>Specify the type and (not always compulsory) flavour (byte-wise symmetric key length, bit-wise asymmetric key length,
150-
elliptic curve identifier, etc.) of the key to create, for example RSA:2048, EC:prime256v1, GOSTR3410-2012-256:B,
150+
elliptic curve identifier, etc.) of the key to create, for example RSA:2048, EC:prime256v1, EC:ED25519, EC:X448, GOSTR3410-2012-256:B,
151151
DES:8, DES3:24, AES:16, AES: or GENERIC:64. If the key type was incompletely specified, possible values are listed.</para></listitem>
152152
</varlistentry>
153153

@@ -332,6 +332,16 @@
332332
the <option>--login</option> option.</para></listitem>
333333
</varlistentry>
334334

335+
<varlistentry>
336+
<term>
337+
<option>--public-key-info</option>
338+
</term>
339+
<listitem><para>Read public key from the module using "CKA_PUBLIC_KEY_INFO"
340+
(use with <option>--read-object --type public</option>).
341+
The output is a "SubjectPublicKeyInfo" i.e. as used in certificates
342+
and openssl.</para></listitem>
343+
</varlistentry>
344+
335345
<varlistentry>
336346
<term>
337347
<option>--puk</option> <replaceable>puk</replaceable>

doc/tools/pkcs15-init.1.xml

+8-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,14 @@
138138
<para>
139139
where <replaceable>keyspec</replaceable> describes the algorithm and the parameters
140140
of the key to be created. For example, <literal>rsa:2048</literal> generates a RSA key
141-
with 2048-bit modulus. If you are generating an EC key, the curve designation must
142-
be specified, for example <literal>ec:prime256v1</literal>. For symmetric key,
141+
with 2048-bit modulus, default is 3072. If you are generating an EC key, the curve designation must
142+
be specified, for example <literal>ec:prime256v1</literal>.
143+
The following curves do not need parameters:
144+
Edwards 25519 curves use one of these equivalent names: Ed25519(preferred), ed25519 or edwards25519
145+
and for the 448 curve use: Ed448.
146+
For Montgomery 25519 curves use one of these equivalent names: X25519(preferred), cv25519 or curve25519
147+
and for the 448 curve use: X448.
148+
For symmetric key,
143149
the length of key is specified in bytes, for example <literal>AES:32</literal>
144150
or <literal>DES3:24</literal>.
145151
</para>

doc/tools/tools.html

+14-3
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@
14901490
</span></dt><dd><p>Generate a new key.</p></dd><dt><span class="term">
14911491
<code class="option">--key-type</code> <em class="replaceable"><code>specification</code></em>
14921492
</span></dt><dd><p>Specify the type and (not always compulsory) flavour (byte-wise symmetric key length, bit-wise asymmetric key length,
1493-
elliptic curve identifier, etc.) of the key to create, for example RSA:2048, EC:prime256v1, GOSTR3410-2012-256:B,
1493+
elliptic curve identifier, etc.) of the key to create, for example RSA:2048, EC:prime256v1, EC:ED25519, EC:X448, GOSTR3410-2012-256:B,
14941494
DES:8, DES3:24, AES:16, AES: or GENERIC:64. If the key type was incompletely specified, possible values are listed.</p></dd><dt><span class="term">
14951495
<code class="option">--usage-sign</code>
14961496
</span></dt><dd><p>Specify 'sign' key usage flag (sets SIGN in privkey, sets VERIFY in pubkey).</p></dd><dt><span class="term">
@@ -1571,6 +1571,11 @@
15711571
environment variable <em class="replaceable"><code>VARIABLE</code></em> is
15721572
used.</p><p>This option will also set
15731573
the <code class="option">--login</code> option.</p></dd><dt><span class="term">
1574+
<code class="option">--public-key-info</code>
1575+
</span></dt><dd><p>Read public key from the module using "CKA_PUBLIC_KEY_INFO"
1576+
(use with <code class="option">--read-object --type public</code>).
1577+
The output is a "SubjectPublicKeyInfo" i.e. as used in certificates
1578+
and openssl.</p></dd><dt><span class="term">
15741579
<code class="option">--puk</code> <em class="replaceable"><code>puk</code></em>
15751580
</span></dt><dd><p>Supply User PUK on the command line.</p></dd><dt><span class="term">
15761581
<code class="option">--new-pin</code> <em class="replaceable"><code>pin</code></em>
@@ -2004,8 +2009,14 @@
20042009
</p><p>
20052010
where <em class="replaceable"><code>keyspec</code></em> describes the algorithm and the parameters
20062011
of the key to be created. For example, <code class="literal">rsa:2048</code> generates a RSA key
2007-
with 2048-bit modulus. If you are generating an EC key, the curve designation must
2008-
be specified, for example <code class="literal">ec:prime256v1</code>. For symmetric key,
2012+
with 2048-bit modulus, default is 3072. If you are generating an EC key, the curve designation must
2013+
be specified, for example <code class="literal">ec:prime256v1</code>.
2014+
The following curves do not need parameters:
2015+
Edwards 25519 curves use one of these equivalent names: Ed25519(preferred), ed25519 or edwards25519
2016+
and for the 448 curve use: Ed448.
2017+
For Montgomery 25519 curves use one of these equivalent names: X25519(preferred), cv25519 or curve25519
2018+
and for the 448 curve use: X448.
2019+
For symmetric key,
20092020
the length of key is specified in bytes, for example <code class="literal">AES:32</code>
20102021
or <code class="literal">DES3:24</code>.
20112022
</p><p>

src/common/libpkcs11.h

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#ifndef __LIBPKCS11_H
2222
#define __LIBPKCS11_H
23+
#include "pkcs11/pkcs11.h"
2324
void *C_LoadModule(const char *name, CK_FUNCTION_LIST_PTR_PTR);
2425
CK_RV C_UnloadModule(void *module);
2526
#endif

0 commit comments

Comments
 (0)