aspose file tools*
The moose likes Java in General and the fly likes Using private key installed on Sun One web server in java code. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using private key installed on Sun One web server in java code." Watch "Using private key installed on Sun One web server in java code." New topic
Author

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

Nandan Jain
Ranch Hand

Joined: Feb 14, 2006
Posts: 44
Hi,

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);
in.close();

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!

Regards,
Nandan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using private key installed on Sun One web server in java code.
 
Similar Threads
secure web services - certificate problem.
Corrupt keystore?
how do i programmatically create a keystore and import my certificate into it?
regarding cacerts from JAVA_HOME\jre\lib\security
CertificateException: No name matching <hostname> found.