1

In my application I have to add the non trusted server certificate to my keystore programmatic. I got the X509 certificate and I belive I have to add to the keystore using keyStore.setCertificateEntry() method.

But the the method accepts java.security.cert.Certificate, when I pass the X509 certificate it gives error. But in many places even in android source code they are passing X509 certificate for java.security.cert.Certificate.

What I am doing wrong ?

meanwhile if you have any links for proper handling of server certificate please share it. All the links I found was to ignore the certificates.

Thanks in advance.

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
user977816
  • 81
  • 1
  • 3
  • I would have expected that you would need to download and import the certificate into the keystore (BouncyCastle download for Android I believe). Also see http://stackoverflow.com/questions/5256356/adding-ssl-certificate-to-keystore – mikey Oct 10 '11 at 08:24

0 Answers0