You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
694 B
28 lines
694 B
#!/usr/bin/bash
|
|
|
|
echo GENERATING TEMPORARY KEY PAIRS FOR TESTS
|
|
|
|
rm -r /tmp/keys
|
|
mkdir /tmp/keys
|
|
cd /tmp/keys
|
|
keytool -genkey -noprompt \
|
|
-alias key \
|
|
-keyalg RSA \
|
|
-validity 1 \
|
|
-keystore test.keystore \
|
|
-storetype PKCS12 \
|
|
-dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB" \
|
|
-storepass 123456789 \
|
|
-keypass 123456789
|
|
|
|
keytool -noprompt -export \
|
|
-alias key \
|
|
-keystore test.keystore \
|
|
-rfc \
|
|
-file public.cert \
|
|
-keypass 123456789 \
|
|
-storepass 123456789
|
|
|
|
echo "123456789" | openssl pkcs12 -in test.keystore -nodes -nocerts -out private.pcks 2> /dev/null
|
|
echo "123456789" | openssl pkcs12 -in test.keystore -nokeys -out public.cert 2> /dev/null
|