• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 586
  • Last Modified:

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

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
jamie_lynn
Asked:
jamie_lynn
1 Solution
 
jamie_lynnAuthor Commented:
Yeah.. i don't think I get generate and load to trust store programatically.
Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now