在 iOS 7 中,应用程序可以读取所谓的“大统一收据”(WWDC 2013,presentation 308),以前仅在 Mac OS X 上可用。它包含有关用户购买应用程序的所有信息,应用程序内购买等等,并且它是加密的,因此用户无法创建假的。苹果有一个关于如何实现它的教程,但并不完全清楚从哪里获取一些数据。
在教程中,有示例代码:
/* The PKCS #7 container (the receipt) and the output of the verification. */
BIO *b_p7;
PKCS7 *p7;
/* The Apple root certificate, as raw data and in its OpenSSL representation. */
BIO *b_x509;
X509 *Apple;
/* The root certificate for chain-of-trust verification. */
X509_STORE *store = X509_STORE_new();
我们怎么可能在 iOS 上加载这些?有一个名为“ValidateStoreReceipt”的 Github 项目,其中包含一些示例代码,但它是为 OS X 量身定制的。OSX 可以访问 OpenSSL,而在 iOS 上则首选使用 Security.h 模块。实施“大统一收据”的最佳方式是什么?