question

karthikp avatar image
karthikp asked karthikp commented

Installing user certificates using adb

I am working on a clover station 2016 dev kit, we are in development and not yet ready with certificates signed by external signing authority. In emulator we have installed certificates using
Settings -> Security -> Trusted Credential -> User tab. Since the settings are disables in clover device, is there any other way we can install these certificates. This would be only for development, we would use symantec signed certificates in our prod server.
Clover StationClover Station 2018Clover Go
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Raymond Lee avatar image
Raymond Lee Deactivated answered karthikp commented
Since you need root to install user certificates through adb, the only solution would be to do it programmatically in your app.

You can use android's KeyChain's method KeyChain.createInstallIntent() to bring up a prompt for the user to install the certificate. This stackoverflow question shows how to do so.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

karthikp avatar image karthikp commented ·

Thanks Raymond, that worked!! :)

0 Likes 0 ·
Raymond Lee avatar image
Raymond Lee Deactivated answered Raymond Lee Deactivated edited
This stackoverflow answer has a method of installing user certificates using adb through bash:
https://stackoverflow.com/a/48814971

Edit: As mentioned by @KarthikP, this requires root, so it is not possible to do on our DevKits. See my other answer for the only solution.
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

karthikp avatar image karthikp commented ·

Actually we can't root the clover device right?
Hence the commands given won't work for us. Could you please provide any insight on this?

0 Likes 0 ·
Raymond Lee avatar image Raymond Lee karthikp commented ·

Ah, you are correct, I overlooked that you need root to run those commands. I will post another solution.

1 Like 1 ·

Welcome to the
Clover Developer Community