Re: How to import a private key in keystore?

Jan Luehe (luehe@laguna.eng.sun.com)
Fri, 6 Nov 1998 10:07:43 -0800 (PST)

Sabine:

> I would like to know if it is possible to import a private key to my
> keystore with the keytool command.
> The fact is that I need in a client applet to get the private key of the
> user to initialize a SSL connexion.
> After some investigations, I found out that there are no API to get
> certificates and private key from Netscape certificate database. So my
> idea is to export certificates and public key from Netscape certificate
> database to import them to Sun keystore.

"keytool" does not provide a command option for importing
a private key.
This means that you have to use the

java.security.KeyStore.setKeyEntry()

API method to accomplish what you are trying to do.

Jan