GooglePlay的公钥文件生成
在GooglePlay注册应用后会提供给我们一个公钥,用来做验证,公钥编码为Base64编码,加解密算法采用的是RSA;
这里校验所用的第三方库是openssl;
运行oepnssl的目录下的out32dll/openssl.exe
这里分两步来进行公钥文件的生成
1.生成编码后的中间文件 pb.tmp
enc -base64 -d -in publickey.base64 -A -out pb.tmp 【注:publickey.base64这个文件里面复制粘贴GooglePlay提供的公钥】
2.生成校验用的公钥文件public.pem
rsa -inform DER -pubin -in pb.tmp -out public.pem
得到public.pem文件后,就可以使用oepnssl库和这个文件来对GooglePlay IAP等经过数字签名的数据进行校验了;

浙公网安备 33010602011771号