110,534
社区成员
发帖
与我相关
我的任务
分享
$key = openssl_get_publickey('provided_public_key'));
openssl_public_decrypt(base64_decode($_GET['signature']), $hashExpected, $key);
RsaKeyParameters pubkey;
using (var sr = new StreamReader("e:\\pubkey.pem"))
{
var pemReader = new Org.BouncyCastle.OpenSsl.PemReader(sr);
pubkey = (RsaKeyParameters)pemReader.ReadObject();
}
var cipher = CipherUtilities.GetCipher("RSA/NONE/PKCS1PADDING");
cipher.Init(false, pubkey);
var data = Convert.FromBase64String(signature);
var hashExpected = cipher.DoFinal(data);
hashExpected就是解密后的字节数组