Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8134971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:14:52+00:00 2026-06-06T10:14:52+00:00

For an application I am developping, I need to be able to install CA

  • 0

For an application I am developping, I need to be able to install CA and user certificates and private keys without his or hers concent.

I will have full system priviledges, and its fair to assume that the user will have a password before this happens. I will have the x509 if its a CA certificate or the pk12 if its a User certificate + private key file, and also the password if its the USer certificate + private key. I need to do this to be able to set up WPA-EAP wifi configurations automatically, and prefibly I want this to happen without the employees having to notice anything.

If anyone also know how to list all certificates that is installed, I would be very grateful.

I have checked throughout the day, and tested a bit with keystore_cli without success, and I have also read through the CertInstaller code without getting any wiser. Everything there is package-wide so I cannot call the methods directly, + it seems to send stuff further away to com.android.settings”, “com.android.settings.CredentialStorage”.

Any advice would be very great.


EDIT For those wondering, here is how I did it with the CA Certificates. The application needs to be able to run as the system user ( android:sharedUserId="android.uid.system" in android manifest ).

            // Android...why do you enjoy doing my life so difficult...
            try {
                Class<?> keyStoreClass = WifiConfiguration.class.getClassLoader().loadClass("android.security.KeyStore");

                Method getInstanceMethod = keyStoreClass.getMethod("getInstance");
                Object keyStore = getInstanceMethod.invoke(null);

                Log.d("DeviceManager", "Got keystore" + keyStore.toString());

                // Put(Key, Value)
                Method putCertificateMethod = keyStoreClass.getMethod("put", String.class, byte[].class);

                Log.d("DeviceManager", "Putting...");

                RandomAccessFile file = new RandomAccessFile("/data/ca.crt", "r");
                byte[] b = new byte[(int)file.length()];
                file.read(b);
                byte[] cacert = b;

                Log.d("DeviceManager", "Certificate is bytes long: " + b.length);

                putCertificateMethod.invoke(keyStore, "CACERT_name", cacert);


            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            } catch (NoSuchMethodException e) {
                e.printStackTrace();
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:14:54+00:00Added an answer on June 6, 2026 at 10:14 am

    Fortunately this is not possible on a stock device. Otherwise, any rogue app will be able to install CA certificates without user consent. If you have small set of devices, you might have to pre-provision them. As for PKCS#12 files, they are password protected so someone will need to enter the password.

    Not sure what you mean by ‘full system privileges’, but if you can link your app with platform code and sign it with the system certificate, you can call KeyChainService methods directly. This will let you install certificates. Additionally, CA certificates are just stored as files, so you can copy them over to the right place. Some details here: http://nelenkov.blogspot.jp/2011/11/ics-credential-storage-implementation.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a web application where I have a need to be able to
I am developping a Cocoa application and I have a special need. In my
I am developing an application in asp.net mvc where i need to have Chat
I am developing LOB application, where I will need multiple dialog windows (and displaying
I am developping an application where I need to draw a graph on the
I'm developing an application with javascript. What I need is to have divs with
I have a USB device that I need to be able to talk to
I'm developing an application that will need to communicate with itself running on different
I have been developing Android application, and I need to read PDF-files in my
I need to offer the opportunity to install a personalized Adobe Air application from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.