EldoS | Feel safer!

Software components for data protection, secure storage and transfer

how to get a certificate from android key store

Posted: 10/21/2015 05:52:08
by BILLARD Thierry (Standard support level)
Joined: 10/21/2015
Posts: 2


I'm trying to get a x509 certificate from the android key store.
I have tested the code given in this post :


and tried with 'AndroidKeyStore'. But it doesn't work. Actually, certSore.getSystemStores() always returns null.

Other parts of my project using xml blackbox to generate a signature are already working, so I suppose that my license key is good.

I can also get my X509certificate using TrustManagerFactory, however it doesn't help me since I don't know if I can create a TElX509Certificate from a X509Certificate.

Is there a minimum level api ? I 'm currently using API level 18 (Android 4.3.1).

Thank you.
Posted: 10/21/2015 06:00:15
by Vsevolod Ievgiienko (Team)

Thank you for contacting us.

Is there a minimum level api ?

At least API level 18 is required.

The code should look this way:

TElJavaCertStorage c = new TElJavaCertStorage(context);

You can also use TElX509Certificate.FromX509Certificate method to convert X509Certificate and PrivateKey to TElX509Certificate instance.
Posted: 10/30/2015 12:04:44
by BILLARD Thierry (Standard support level)
Joined: 10/21/2015
Posts: 2

Thank you for your help.

I have tried this code:
      Context context = MyApplication.getContext();
      TElJavaCertStorage certStore = new TElJavaCertStorage(context);

      System.out.println("count: "+certStore.getCount());
But certStore count is always 0. Any idea about what I've missed?
Posted: 11/02/2015 04:51:02
by Vsevolod Ievgiienko (Team)


Your code is correct. I've just re-checked if TElJavaCertStorage works correctly on Android device. Looks like you simply have 0 certificates in the store.



Topic viewed 2809 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!