我是OpenSSL的新手,我正在尝试用python在本地验证itunesiap回执。在
The outermost portion (labeled Receipt in the figure) is a PKCS #7 container, as defined by RFC 2315, with its payload encoded using ASN.1 (Abstract Syntax Notation One), as defined by ITU-T X.690. The payload is composed of a set of receipt attributes. Each receipt attribute contains a type, a version, and a value.
import OpenSSL
f = open('sample_IAP_receipt_base64.txt', 'r').read()
type = OpenSSL.crypto.FILETYPE_ASN1
data = OpenSSL.crypto.load_pkcs7_data(type, f)
print f
此测试似乎生成了一个错误:
^{pr2}$有什么办法让它工作吗?在
我的建议是使用现有的python包,itunes iap是一个不错的包:
https://pypi.python.org/pypi/itunes-iap
唯一可以在本地完成此操作的是这个库:
https://github.com/SilentCircle/iap-local-receipt
相关问题 更多 >
编程相关推荐