[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iaik-jce] Problem in deserializing a RSAPrivateKey Object


I am new to this mailing list.
I have written an application that generate and serialize both RSAPrivateKey and 
RSAPublicKey and another that load and deserialize them in order to perform 
some String en/decrypt.

The RSAPublicKey is successfully deserialize and I can use correctly it 
for encrypted. After deserialising the RSAPrivateKey with no any exception, when 
I call

  Cipher rsa_dec = Cipher.getInstance("RSA", "IAIK");
  rsa_dec.init(Cipher.DECRYPT_MODE, this.KeyPri);

I have the following

Exception: java.security.InvalidKeyException: Not an RSA key.
java.security.InvalidKeyException: Not an RSA key.
        at iaik.pkcs.pkcs1.RSACipher.engineInit(Unknown Source)
        at javax.crypto.Cipher.init(Unknown Source)
        at CryptoLoad.<init>(CryptoLoad.java:50)
        at CryptoLoad.main(CryptoLoad.java:117)

Plataform: Sun Solaris 2.7 x386 with Sun JDK_1.1.7_08, IAIK-JCE 2.5beta1

Have you some idea ?

Thanks for your help

		Paolo Sommaruga
		Garda Access
		Garda, Italy

Mailinglist-archive at http://jcewww.iaik.tu-graz.ac.at/mailarchive/iaik-jce/maillist.html

To unsubscribe send an email to listserv@iaik.tu-graz.ac.at with the folowing content: UNSUBSCRIBE iaik-jce