Solved

How do I generate a self-signed certificate and import it into the truststore using apis?

Posted on 2013-01-02
2
575 Views
Last Modified: 2013-01-04
Hi,
How do I generate a self-signed certificate and import it programatically using apis?

Would CertificateFactory.getInstance("X.509").generateCertificate() generate the certificate?

How do I import the generated certificate into the trust store via api?
I cannot use the commandline tool keytool.
But the commandline equivalent would be
keytool -import -v -trustcacerts -alias serveralias -file server.cer -keystore cacerts.jks -keypass changeit -storepass changeit

Thanks
Jamie
0
Comment
Question by:jamie_lynn
2 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 38739308
0
 

Author Closing Comment

by:jamie_lynn
ID: 38745786
Yeah.. i don't think I get generate and load to trust store programatically.
Thanks!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
oracle 11g 23 107
hibernate jars 4 45
jmss example java 2 24
Why is enum singleton a better approach than static factory 3 24
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question