2

I have copied my certificate file(x.cer) into my emulator sdcard. Now I want to send that certificate from my android client to the Server.
Earlier I used to do this by putting the certificate into the keystore and then putting the keystore in the sdcard. The keystore class has a function getCertificate(alias).

Now I want to read the certificate directly as I have only copied the certificate and not the keystore. How to do this?

suraj
  • 1,828
  • 12
  • 36
  • 64

1 Answers1

5

Something like

CertificateFactory.getInstance("X.509").generateCertificate(new FileInputStream("path")));

should do it.

How to get hold of the SD card path is described here:

how to get file path from sd card in android

Community
  • 1
  • 1
johsin18
  • 838
  • 7
  • 10