I have a public 2048 bits RSA Key in byte array, I need to encrypt some data but I don't want to encrypt it directly with the public key. I can generate a common symmetric key such as AES to encrypt my data. I want to then encrypt my symmetric key with my public RSA key. I know what I need to do I just know how. I tried converting the byte array to PublicKey object but I get Invalid Key Format Exception. Is there any other way I can make it work? I am using BouncyCastle as my security provider.
Asked
Active
Viewed 128 times
0
-
1We can't tell you what's wrong with your code unless you show it to us. – dbush Sep 24 '18 at 18:44
-
We need to see the code to help :) . Also there are a lot of examples for that in every language.. – user972014 Sep 24 '18 at 18:49