Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using keytool to create RSA keys for Cipher operations ...

1 view
Skip to first unread message

Oliver Pfeiffer

unread,
Jan 12, 2003, 4:30:21 PM1/12/03
to
Hi,

I want to create a RSA keypair in my keystore file to use with a Cipher.
But the Cipher always fails with ...

java.security.InvalidKeyException
at com.sun.crypto.provider.DESCipher.engineGetKeySize(DashoA6275)

But it is a RSA key created by using ...

keytool -genkey -keystore keystore -keyalg rsa -keysize 1024 -alias user

The code looks like this ...

Key key = keystore.getKey( "user", "password".toCharArray() );
Cipher cipher = Cipher.getInstance( "DES" );
cipher.init( Cipher.ENCRYPT_MODE, key );

Any help would be greatly appreciated.

Regards

Oliver

Oliver Pfeiffer

unread,
Jan 12, 2003, 4:55:29 PM1/12/03
to
Oliver Pfeiffer <oliver....@gmx.net> wrote in
news:Xns9301E52E3EE2ol...@pfeiffer.myfqdn.de:

> Cipher cipher = Cipher.getInstance( "DES" );

bullshit ... this is RSA and the Exception looks like this ...

java.security.NoSuchAlgorithmException:
Cannot find any provider supporting RSA
at javax.crypto.Cipher.getInstance(DashoA6275)

In the JCE documentation is written that RSA is supported. Where is the
problem?

--
cu
o.pfeiffer

ICQ# 84320006
eMail oliver....@gmx.net
--------------------------------------------
TECHNOLOGIE - ZENTRUM INFORMATIK / UNIVERSITAET BREMEN / GERMANY

0 new messages