reading RSA public/private keys from keystore in jdk1.5

Hi,

This one is probably easy but I'm blinded somehow. Using jdk1.5_05 with out-of-the-box providers

security.provider.1=sun.security.provider.Sun

security.provider.2=sun.security.rsa.SunRsaSign

security.provider.3=com.sun.net.ssl.internal.ssl.Provider

security.provider.4=com.sun.crypto.provider.SunJCE

security.provider.5=sun.security.jgss.SunProvider

security.provider.6=com.sun.security.sasl.Provider

I have a program that should read public keys from sertificates imported into a keystore,but am unable to read keys created with RSA. Naturally same thing with private keys. DSA keys work, but RSA keys cause error:No installed provider supports this key: sun.security.rsa.RSAPublicKeyImpl. I tried importing certificate into JKS and JCEKS but same result. Shouldn't RSA be available using SunJCE?

I am hoping to be able to use tools bundled in jdk, is this possible?

[943 byte] By [dt_a] at [2007-10-2 10:03:07]
# 1

> I am hoping to be able to use tools bundled in jdk,

> is this possible?

I'm not sure... why not try bouncy castle?

http://www.bouncycastle.org/

http://www.bouncycastle.org/download/bcprov-jdk15-131.jar

Put the jar in the correct place. On my system:

/usr/share/java

And add the following line to java.security file:

security.provider.7=org.bouncycastle.jce.provider.BouncyCastleProvider

_bensmytha at 2007-7-13 1:15:45 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

Some of the example code from [url=http://books.elsevier.com/us//mk/us/subindex.asp?maintarget=companions/defaultindividual.asp&isbn=0127427511&country=United+States&srccode=&ref=&subcode=&head=&pdf=&basiccode=&txtSearch=&SearchField=&operator=&order=&community=mk]Java Cryptography Extensions[/url] may be of use.

_bensmytha at 2007-7-13 1:15:45 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 3
I've certainly generated and imported RSA public keys in JDK5 using keytool as well as programmatically via the KeyStore API.
ghstarka at 2007-7-13 1:15:46 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 4

> I have a program that should read public keys from

> sertificates imported into a keystore,but am unable

> to read keys created with RSA. Naturally same thing

> with private keys. DSA keys work, but RSA keys cause

> error: No installed provider supports this key:

> sun.security.rsa.RSAPublicKeyImpl. I tried

> importing certificate into JKS and JCEKS but same

> result. Shouldn't RSA be available using SunJCE?

Posting your code may help us resolve your problem.

_bensmytha at 2007-7-13 1:15:46 > top of Java-index,Security,Other Security APIs, Tools, and Issues...