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 8626615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:04:36+00:00 2026-06-12T08:04:36+00:00

Am I able to extract certificate chain information from a CA-signed X509 client certificate

  • 0

Am I able to extract certificate chain information from a CA-signed X509 client certificate using Android or BouncyCastle libs?

I have an Android client that receives a CA-signed X509 certificate from a trusted server. I want to save the signed client certificate and my private key to a PKCS12 (.p12) file. I am currently doing this by creating a KeyStore object and adding the certificate and private key. When I add the client PrivateKey with the KeyStore.setKeyEntry() method, a Certificate[] chain is the last argument, which currently only contains the client certificate. Will this prevent my certificate from being verifiable because I don’t have the CA certificate in the Certificate[] chain? And if yes, is it possible to populate a certificate chain with information extracted from the signed X509Certificate?

Most examples seem to load the CA chain from a PEM file, BKS trust store, or already have access to a list of certificates.

Here is what I have:

    X509Certificate cert;      // signed client cert
    PrivateKey pkey;           // client private key
    String password; 

    KeyStore store;
    store = KeyStore.getInstance("PKCS12", "BC");
    store.load(null, null);

    // adding the signed cert
    store.setCertificateEntry("Client certificate", cert);

    // creating the cert chain
    X509Certificate[] chain = new X509Certificate[1];
    chain[0] = cert;
    // add rest of the certs in the chain here

    // adding the private key   
    store.setKeyEntry("Client private key", pkey, password.toCharArray(), chain);

    FileOutputStream fos;
    fos = openFileOutput("clientCredentials.p12", Context.MODE_PRIVATE);
    store.store(fos, password.toCharArray());
    fos.flush();
    fos.close();

Thanks in advance!

  • 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-12T08:04:37+00:00Added an answer on June 12, 2026 at 8:04 am

    The CA certificate(s) are not included in your signed certificate. You have to get them from somewhere (pre-install, download from trusted server, etc.). As for not installing the full chain, if the verifier already has access to necessary CA certificates, they can always verify your end entity certificate. How do you intend to use your key and certificate?

    BTW, your call to setCertificateEntry() creates a trusted certificate entry which is probably not what you want with an end entity certificate.

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

Sidebar

Related Questions

Hi I have been able to extract a VARCHAR to a date using string_to_date
I am currently able to extract a private key from a PFX file using
I wanted to extract the Signer Informations from PKCS#7 Signed Code Image using C/CPP.
I am successfully able to extract images from a pdf using pdfsharp. The image
I am using pdfbox library to extract text contents from pdf file.I would able
I have been able to extract certain lines from a large tab-separated text file
I am able to extract my application apk file from PC. I am using
I was able to extract user information from the social Graph API and display
I want to use Perl to extract information from a Certificate Signing Request ,
I want to be able to extract text from text files as tokens -

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.