Hi every body I'm building Client/Server meetings System
I had a problem "Cannot implicitly convert type 'string' to 'System.Security.Cryptography.RSAParameters'"
I will explain the process quickly
- Client Connect to Server
- server send back his public Key
- Client will encrypt the username+his public key By Server public key
I received Server reply ( public key ) but when I tried to encrypt using RSA the error above appeared
This is my Code :
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
// mess is Server response as string
RSAParameters publickey = mess;
rsa.ImportParameters(publickey);
byte[] encryptedData = rsa.Encrypt(StringToByte(uname.Text + "|||" + PUBKEY), true);