Well Ulf, I tried fiddling with it for a bit, and googling the error, and I can't seem to get it...
Here is what I have atm:
And here is the error:
Exception in
thread "main" java.security.InvalidKeyException: Neither a public nor a private key
at sun.security.rsa.RSAKeyFactory.engineTranslateKey(RSAKeyFactory.java:193)
at sun.security.rsa.RSAKeyFactory.toRSAKey(RSAKeyFactory.java:111)
at com.sun.crypto.provider.RSACipher.init(RSACipher.java:260)
at com.sun.crypto.provider.RSACipher.engineInit(RSACipher.java:205)
at javax.crypto.Cipher.init(Cipher.java:986)
at javax.crypto.Cipher.init(Cipher.java:935)
at TestRsa2.encrypt(TestRsa2.java:32)
at TestRsa2.main(TestRsa2.java:70)