KeyPair and Cipher.init() Help
Hi,
I've generated a keypair using KeyPairGenerator and after that saving the public and private keys individually to files as hex. Now when I read the hex back and used SecretKeySpec(byte[],"RSA") to reinstate it as a Key object and plug that into Cipher.init(Cipher.ENCRYPT_MODE,pubKey,random) I come up with an exception.
I've come to discover that if I feed a Key that was generated within the class, that method call is fine, but if I read a pre-generated key from a file, that method doesn't like it. Any ideas?
Regards,
Dave

