Often there is a need to put a certificate on the android device (emulator | real) for testing with SSL. This wil be the case when one needs to use a self signed cert since getting a real CA signed cert is expensive.
The high level steps are :
The high level steps are :
- Export the cert from your current keystore and put it into a file
- Copy the cert file to android device
- Run settings app to add it to the trusted certificates.
The caveat it that the exported file from step 1 needs to be in p12 format.
Here are the detailed steps for Android emulator and using the source keystore as JKS.
- keytool -importkeystore -srckeystore
-destkeystore -deststoretype PKCS12 -srcalias - Start the Android emulator - emulator -avd
& - Wait for this to finish - adb - devices will list the android instances it know about, wait for the emulator to show up here as running.
- adb push
/sdcard/file.p12 - Copies the exported cert file to /sdcard area of Android - Go to Emulator > Settings > Security > Install Trusted Cert from SD card
- Type the password that you specified in step 1
- You should be good to go.
It is even easier for iPhone.
- Just email the cert from step 1 to an email configured on iphone as an attachment
- Open the email from iPhone and click/tap the attachement.
No comments:
Post a Comment