验证服务器端的应用内计费签名
我正在研究应用程序中应用内计费的安全性。
我在服务器上进行验证,这是用 C++ 编写的。
在c++中可以通过哪些方式来验证它?
我可以使用 openssl 命令吗?
I'm working on the security of the in-app billing in my application.
I do the verification on the server, which is in c++.
which ways are possible to verify it in c++?
can I use openssl command?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 OpenSSL 库。您的应用程序从市场收到的响应是一串 JSON 数据和一个签名字符串,该字符串是使用开发人员配置文件中的公钥的私钥创建的。您应该将该公钥保留在您的服务器上,然后您的应用程序可以将 JSON 字符串和签名传递到您的服务器进行验证。
签名字符串是采用 PKCS#1 填充的 base-64 编码的 SHA1-with-RSA 签名。您应该能够使用 OpenSSL EVP_Verify... 函数在 C++ 程序中验证它:
http://www.openssl.org/docs/crypto/evp.html
You can use the OpenSSL library. The response that your app receives from the Market is a string of JSON data and a signature string which is created using the private key for the public key that is in your developer profile. You should keep that public key on your server, then your app can pass on the JSON string and signature to your server for verification.
The signature string is a base-64 encoded SHA1-with-RSA signature with PKCS#1 padding. You should be able to verify it in a C++ program using the OpenSSL EVP_Verify... functions:
http://www.openssl.org/docs/crypto/evp.html