Read and write X25519 and X448 private keys
Signed-off-by: Jethro Beekman <jethro@fortanix.com> Co-authored-by: Gijs Kwakkel <gijs.kwakkel@fortanix.com> Signed-off-by: Gijs Kwakkel <gijs.kwakkel@fortanix.com>
This commit is contained in:
parent
e4072c00c8
commit
0167244be4
19 changed files with 515 additions and 94 deletions
|
@ -1003,6 +1003,38 @@ ec_bp512_pub.comp.pem: ec_bp512_pub.pem
|
|||
$(OPENSSL) ec -pubin -in $< -out $@ -conv_form compressed
|
||||
all_final += ec_bp512_pub.comp.pem
|
||||
|
||||
ec_x25519_prv.der:
|
||||
$(OPENSSL) genpkey -algorithm X25519 -out $@ -outform DER
|
||||
all_final += ec_x25519_prv.der
|
||||
|
||||
ec_x25519_pub.der: ec_x25519_pub.der
|
||||
$(OPENSSL) pkey -in $< -inform DER -out $@ -outform DER
|
||||
all_final += ec_x25519_pub.der
|
||||
|
||||
ec_x25519_prv.pem: ec_x25519_prv.pem
|
||||
$(OPENSSL) pkey -in $< -inform DER -out $@
|
||||
all_final += ec_x25519_prv.pem
|
||||
|
||||
ec_x25519_pub.pem: ec_x25519_pub.pem
|
||||
$(OPENSSL) pkey -in $< -inform DER -out $@
|
||||
all_final += ec_x25519_pub.pem
|
||||
|
||||
ec_x448_prv.der:
|
||||
$(OPENSSL) genpkey -algorithm X448 -out $@ -outform DER
|
||||
all_final += ec_x448_prv.der
|
||||
|
||||
ec_x448_pub.der: ec_x448_pub.der
|
||||
$(OPENSSL) pkey -in $< -inform DER -out $@ -outform DER
|
||||
all_final += ec_x448_pub.der
|
||||
|
||||
ec_x448_prv.pem: ec_x448_prv.pem
|
||||
$(OPENSSL) pkey -in $< -inform DER -out $@
|
||||
all_final += ec_x448_prv.pem
|
||||
|
||||
ec_x448_pub.pem: ec_x448_pub.pem
|
||||
$(OPENSSL) pkey -in $< -inform DER -out $@
|
||||
all_final += ec_x448_pub.pem
|
||||
|
||||
################################################################
|
||||
#### Convert PEM keys to DER format
|
||||
################################################################
|
||||
|
|
BIN
tests/data_files/ec_x25519_prv.der
Normal file
BIN
tests/data_files/ec_x25519_prv.der
Normal file
Binary file not shown.
3
tests/data_files/ec_x25519_prv.pem
Normal file
3
tests/data_files/ec_x25519_prv.pem
Normal file
|
@ -0,0 +1,3 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MC4CAQAwBQYDK2VuBCIEILBtgpZVVDpRy6NuU1IrwKz9YK9ZRmVV+z4eeWhyqxpZ
|
||||
-----END PRIVATE KEY-----
|
BIN
tests/data_files/ec_x25519_pub.der
Normal file
BIN
tests/data_files/ec_x25519_pub.der
Normal file
Binary file not shown.
3
tests/data_files/ec_x25519_pub.pem
Normal file
3
tests/data_files/ec_x25519_pub.pem
Normal file
|
@ -0,0 +1,3 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MCowBQYDK2VuAyEAm8Ow6T2CM/5qi6YTiUjMEqkTYtXC7YFYTbBatUGcnRE=
|
||||
-----END PUBLIC KEY-----
|
BIN
tests/data_files/ec_x448_prv.der
Normal file
BIN
tests/data_files/ec_x448_prv.der
Normal file
Binary file not shown.
4
tests/data_files/ec_x448_prv.pem
Normal file
4
tests/data_files/ec_x448_prv.pem
Normal file
|
@ -0,0 +1,4 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MEYCAQAwBQYDK2VvBDoEOGTpCDYD9atLDMYwDnjdwUTkjO4ZMB/uacXKw+4iUiED
|
||||
oe50tXsIxi5REqWe2YOoL7eD7npOGRPt
|
||||
-----END PRIVATE KEY-----
|
BIN
tests/data_files/ec_x448_pub.der
Normal file
BIN
tests/data_files/ec_x448_pub.der
Normal file
Binary file not shown.
4
tests/data_files/ec_x448_pub.pem
Normal file
4
tests/data_files/ec_x448_pub.pem
Normal file
|
@ -0,0 +1,4 @@
|
|||
-----BEGIN PUBLIC KEY-----
|
||||
MEIwBQYDK2VvAzkAlrVhn5KDNBt3nL38B9mqGKqrPwnah3ynJgaWQ5IcLzv6zZT+
|
||||
TIjhGQ1NFGWwgtOV8UqU2tO4pYQ=
|
||||
-----END PUBLIC KEY-----
|
Loading…
Add table
Add a link
Reference in a new issue