File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using private key installed on Sun One web server in java code.

Nandan Jain
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am digitally signing an XML string. I have been able to successfully do this using the .keystore and the JSSE API. Now I need to run this code in the SUN ONE Web server, hence i have installed the self signed certs in the web server.

How do i access the private key in my code now? Earlier i was just using the follwoing calls:

KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());

// Load the keystore contents
FileInputStream in = new FileInputStream(keystoreFile);
keystore.load(in, keystorePassword);

now how do i access the private key and the certs that i have added in the web server? is there another API for this?

Any help will be appreciated!

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic