Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Create keystore and truststore programatically

Ranch Hand
Posts: 64
Oracle Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody, I want to make a Java App to manage certificates.

For example, for a keystore, in the requirements I've received, I need two files that I've already have:
1. Certificate (.cer or .pem extension),
2. the private key file (.key extension).
I wonder to know how can I create my own keystore with these files, how do I set the alias, password and all what my keystore needs.

Now, what I've also been asked for is to create a truststore based on the keystore:
- Generate a .CER file from keystore.jks
- Import .cer file into a new file named truststore.jks
- Import Root certificate (which I already have)
- Import Intermediate certificate (which I already have)

And I know that all what I want is possible with the "keytool" java offers, but I need an application that can do all this process. I've been thinking on using the Runtime class to execute keytool commands, but for some of the commands I need a confirmation and I couldn't manage to find how to accept or decline a command executed from java.

Is there maybe a framework for this kind of job. I'd really appreciate your help and thanks in advanced.
Posts: 22015
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about KeyStore? (<= click on it)
No thanks. We have all the government we need. This tiny ad would like you to leave now:
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic