Hi i am trying o generate my public key for my RSA 4096 encryption in my windows phone 8 ecryption app
i am using this method:
RSACryptoServiceProvider rsaProvider = new RSACryptoServiceProvider(4096); var pub_key = rsaProvider.ExportParameters(false); // export public key
and now i am trying to convert the pub_key to a pem format so i can send it to the server i am doing the below step
Byte[] bpkey = Combine(pub_key.Modulus, pub_key.Exponent);
i am combining the byte array into one using " RSA public key = modulus + exponent "
string pkey = "----BEGIN PUBLIC KEY----\n" + Convert.ToBase64(bpkey)+ "\n----END PUBLIC KEY----";
but i am getting that the pkey is an invalid pem format when i send it to the server!!!
any idea how to it correctly or how to fix the error.