6
我需要在WP8上使下面的代碼工作,問題是WP8上沒有X509Certificate2類,我嘗試過使用彈性城堡API,但我沒有真正設法計算它出。X509Certificate2到Windows Phone上的X509證書8
有沒有辦法讓這個代碼在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;
}
我會試試,謝謝 – jjdev80 2013-05-02 19:28:01
@MaryJ。你有看過嗎? – likeitlikeit 2013-05-05 20:11:36
不,對不起,我還沒有時間做到這一點呢 – jjdev80 2013-05-08 08:11:52