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

[iaik-jce] Save PublicKey in a File



hello ,

I want to save a Public Key in a file ..

----------------------------------------------------------------------------
----
RSAPrivateKey rsa_priv = (RSAPrivateKey)key_pair.getPrivate();
RSAPublicKey rsa_pub = (RSAPublicKey)key_pair.getPublic();

 // #################### save PublicKey in File ####################
        byte [] rsa_pub_key = rsa_pub.encode();
        FileOutputStream pubfos = new
FileOutputStream("C:\\...\\rsapubKey.txt");
        pubfos.write(rsa_pub_key);

        pubfos.close();
----------------------------------------------------------------------------
-------------------------

and the following error occurs : "method encode() not found in class
iaik.security.rsa.RSAPublicKey"
But the method encode() exist !

Ok, saving key pairs in a Keystore is better, but this is only for test
purpose.


regards
henrik




--
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