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

AW: [iaik-jce] Unknown private key type



Hello,

what´s the way you are creating the RSA private key from modulus and
exponent? Please note that you may loss any CRT components when handling
the key in this way. Also please be aware that you do not apply any
protection to your pricate key when storing it in a file the way you discribed.
It might be more appropriate to use a format like PKCS#8 or PKCS#12 (if you
have a cert chain accompaning the private key) or to save the key 
immediately to the keystore without doing the intermediate ObjectOutput-
ObjectInputStream step. Please be aware that a keystore only allows to save
private keys together with their certificate. If you does not have a certificate
yet available, when using JDK11x you may supply a null certificate, when using
JDK 1.2 or higher you may create a dummy cert to later be replaced by the
right cert when, for instance, getting it from the CA.

Regards,
Dieter Bratko

-----Ursprüngliche Nachricht-----
Von: iaik-jce-owner@iaik.tu-graz.ac.at
[mailto:iaik-jce-owner@iaik.tu-graz.ac.at]Im Auftrag von Baernreuther
Rainer
Gesendet: Dienstag, 31. Juli 2001 15:18
An: 'iaik-jce@iaik.at'
Betreff: [iaik-jce] Unknown private key type


Hi,

I have a problem with the IAIKKeystore. First I create a private RSA key and
store it to a file. To perform this I fetch the modulus and the private
exponent
out of the RSAPrivateKey object and write them on disk using an
ObjectOutputStream. Later on I read the modulus and the exponent with an
ObjectInputStream from disk and create a RSAPrivateKey object out of them.
Then I try to save this new RSAPrivateKey in a KeyStore but I always get the
following Exception:
java.security.KeyStoreException: Unknown private key type.

Perhaps anyone can tell me what's going wrong.

Best regards

--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

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


--
Mailinglist-archive at http://jcewww.iaik.at/mailarchive/iaik-jce/jcethreads.html

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