I need to make the following code for WP8, the problem is that on WP8 there is no X509Certificate2 class, I tried to use bouncy castle apis, but I could not figure it out.
Is there a way to get this code to work on WP8?
private string InitAuth(X509Certificate2 certificate, string systemId, string username, string password) { byte[] plainBytes = Encoding.UTF8.GetBytes(password); var cipherB64 = string.Empty; using (var rsa = (RSACryptoServiceProvider)certificate.PublicKey.Key) cipherB64 = systemId + "^" + username + "^" + Convert.ToBase64String(rsa.Encrypt(plainBytes, true)); return cipherB64; }
source share