I am trying to create a keystore "bks" using keytool (using a terminal application on Mac OS X). I follow the instructions in:
keytool error: java.security.KeyStoreException: BKS not found
This is my use:
keytool -genkeypair -v -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 -keypass android -keystore /Users/djames/dropbox/bc146keystore/debug.keystore -storepass android -storetype BKS -providerclass org.bouncycastle.jce.provider.BouncyCastleProvider –providerpath /Users/djames/dropbox/bc146keystore/bcprov-jdk16-146.jar -dname "CN=Android Debug, OU=Android, O=Android, L=Whitefish, S=MT, C=US"
I get the following error:
keytool error: java.lang.RuntimeException: Usage error, ?providerpath is not a legal command java.lang.RuntimeException: Usage error, ?providerpath is not a legal command at sun.security.tools.KeyTool.parseArgs(KeyTool.java:375)
I saw the -provider path option recommended in countless web posts (including the ones above), and when I run keytool -help , it confirms that the syntax is legal:
keytool usage: ... -genkeypair [-v] [-protected] [-alias <alias>] [-keyalg <keyalg>] [-keysize <keysize>] [-sigalg <sigalg>] [-dname <dname>] [-validity <valDays>] [-keypass <keypass>] [-keystore <keystore>] [-storepass <storepass>] [-storetype <storetype>] [-providername <name>] [-providerclass <provider_class_name> [-providerarg <arg>]] ... [-providerpath <pathlist>]
I also tried the following alternative (for http://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html ):
- Removing the
-providerpath option of the -providerpath command, - placing
bcprov-jdk16-146.jar inside the {$JAVA_HOME/lib/ext} folder - adding
security.provider.3=org.bouncycastle.jce.provider.BouncyCastleProvider to the java.security file.
But this still failed.
Any ideas on what I can do differently to succeed in building the BKS repository?
bouncycastle keystore keytool
gymshoe
source share