summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2014-11-18 10:18:18 +0100
committerAndré Klitzing <aklitzing@gmail.com>2015-01-18 10:18:43 +0100
commit962ea5690cb9351822c30da534ecae7aeeba667d (patch)
treec3fef960ae04c61bd55426cc05c7a910b8b48f52 /tests/auto/network/ssl/qsslkey/keys/genkeys.sh
parenta6a865e24999bf878f6f80341b7fc14f2b67a05e (diff)
Add elliptic curve support to QSsl
Add possibility to get length and other information of EC based certificates. Also it is possible to parse those public/private keys from PEM and DER encoded files. Based on patch by Remco Bloemen [ChangeLog][QtNetwork][SSL/TLS support] It is now possible to parse elliptic curve certificates. Change-Id: I4b11f726296aecda89c3cbd195d7c817ae6fc47b Task-number: QTBUG-18972 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/network/ssl/qsslkey/keys/genkeys.sh')
-rwxr-xr-xtests/auto/network/ssl/qsslkey/keys/genkeys.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
index c9f2406cad..279e71e561 100755
--- a/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
+++ b/tests/auto/network/ssl/qsslkey/keys/genkeys.sh
@@ -72,3 +72,25 @@ do
echo -e "\ngenerating DSA public key to DER file ..."
openssl dsa -in dsa-pri-$size.pem -pubout -out dsa-pub-$size.der -outform DER
done
+
+#--- EC ----------------------------------------------------------------------------
+# Note: EC will be generated with pre-defined curves. You can check supported curves
+# with openssl ecparam -list_curves.
+# If OpenSSL 1.0.2 is available brainpool should be added!
+# brainpoolP256r1 brainpoolP384r1 brainpoolP512r1
+for curve in secp224r1 prime256v1 secp384r1
+do
+ size=`tr -cd 0-9 <<< $curve`
+ size=${size::-1} # remove last number of curve name as we need bit size only
+ echo -e "\ngenerating EC private key to PEM file ..."
+ openssl ecparam -name $curve -genkey -noout -out ec-pri-$size-$curve.pem
+
+ echo -e "\ngenerating EC private key to DER file ..."
+ openssl ec -in ec-pri-$size-$curve.pem -out ec-pri-$size-$curve.der -outform DER
+
+ echo -e "\ngenerating EC public key to PEM file ..."
+ openssl ec -in ec-pri-$size-$curve.pem -pubout -out ec-pub-$size-$curve.pem
+
+ echo -e "\ngenerating EC public key to DER file ..."
+ openssl ec -in ec-pri-$size-$curve.pem -pubout -out ec-pub-$size-$curve.der -outform DER
+done