0

I want to use .pem format certificate and .pkey key in order to create a socket SSL in android. Unfortunately, I found at this post that android prefers a different format, the BKS format. As described at this post, we can convert PEM to BKS via the Portecle.

However i cannot install Portege in Ubuntu. When i run:

java -jar /usr/share/java/portecle.jar

I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PasswordFinder
    at java.lang.ClassLoader.defineClass1(Native Method)

    ...

    ...

UPDATE

I forgot to transfer the bcprov.jar to the

/usr/share/java

folder.

I transferred it. But now, when i running

 java -jar /usr/share/java/portecle.jar

,i get:

no main manifest attribute, in /usr/share/java/portecle.jar
Community
  • 1
  • 1
zoe vas
  • 281
  • 9
  • 25
  • Possible duplicate of [Trouble integrating BouncyCastle Jar](http://stackoverflow.com/questions/10134161/java-having-trouble-integrating-bouncycastle-jar) – jww Aug 27 '14 at 07:48

2 Answers2

2

I just followed these steps:

  • Downloaded .zip from: http--sourceforge.net/projects/portecle/
  • Exploded the .zip file
  • Noticed in README.txt that the minimum requirement is Java SE 6
  • Executed java -version and noticed the default one in my system PATH to be java version "1.7.0_65"
  • Executed java -jar portecle-1.7/portecle.jar, and it just showed up the application without any problem.
0

Initially have to download bouncycastle:

http://repo2.maven.org/maven2/org/bouncycastle/bcprov-ext-jdk15on/1.46/bcprov-ext-jdk15on-1.46.jar

Use this commend in command prompt :

keytool -importcert -v -trustcacerts -file "oldfilelocation\mycertfile.pem" -alias ca -keystore "newfilelocation\keystore.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath "jarfilelocation\bcprov-ext-jdk15on-1.46.jar" -storetype BKS -storepass password
serenesat
  • 4,611
  • 10
  • 37
  • 53
javaKoder
  • 1
  • 1