0

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.

0 Answers0