Skip to content

Commit

Permalink
JSSE: add script to convert example .jks files to wolfJCE WKS KeyStor…
Browse files Browse the repository at this point in the history
…e type (.wks)
  • Loading branch information
cconlon committed Jul 3, 2024
1 parent 911dc34 commit 6208c6d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions examples/provider/convert-to-wks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

if [ -z "$1" ]; then
echo "Expected provider location for wolfJCE provider JAR directory."
echo "Example \"./convert-to-wks.sh ~/wolfcryptjni/lib\""
exit 1
fi
PROVIDER_DIR="$1"

# Export library paths for Linux and Mac to find shared JNI library
export LD_LIBRARY_PATH=$PROVIDER_DIR:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$PROVIDER_DIR:$DYLD_LIBRARY_PATH

convert () {
keytool -importkeystore -srckeystore ${1}.jks -destkeystore ${1}.wks -srcstoretype JKS -deststoretype WKS -srcstorepass "wolfSSL test" -deststorepass "wolfSSL test" -provider com.wolfssl.provider.jce.WolfCryptProvider --providerpath "$PROVIDER_DIR/wolfcrypt-jni.jar"

}

rm -f all.bks &> /dev/null
convert "all"

rm -f all_mixed.bks &> /dev/null
convert "all_mixed"

rm -f client.bks &> /dev/null
convert "client"

rm -f client-rsa-1024.bks &> /dev/null
convert "client-rsa-1024"

rm -f client-rsa.bks &> /dev/null
convert "client-rsa"

rm -f client-ecc.bks &> /dev/null
convert "client-ecc"

rm -f server.bks &> /dev/null
convert "server"

rm -f server-rsa-1024.bks &> /dev/null
convert "server-rsa-1024"

rm -f server-rsa.bks &> /dev/null
convert "server-rsa"

rm -f server-ecc.bks &> /dev/null
convert "server-ecc"

rm -f cacerts.bks &> /dev/null
convert "cacerts"

rm -f ca-client.bks &> /dev/null
convert "ca-client"

rm -f ca-server.bks &> /dev/null
convert "ca-server"

0 comments on commit 6208c6d

Please sign in to comment.