问题描述
我正在学习如何在我的iOS / OSX项目中添加应用内购买收据验证。
I am learning how to add in-app purchase receipt validation to my iOS/OSX projects.
有一个很好的概述和WWDC14上有很好的视频这个主题。
There is a nice overview here and the WWDC14 has good videos on this topic.
大量的示例代码,但每个人都跳了一步。如何导入openSSL标头。 swift编译器抱怨没有这样的模块。
Plenty of sample code, but everyone skips one step. How to import the openSSL header. The swift compiler complains that there is no such module.
import Foundation
import StoreKit
import openssl //no such module ???
在编写一行代码之前,我已经陷入困境。 openssl框架隐藏在哪里?
I am already stuck before writing one line of code. Where is the openssl framework hiding?
推荐答案
内置的OpenSSL模块。你必须自己编译 - 这是为了安全性,以便每个人都不会实现完全相同的安全性。
There is no OpenSSL module built in. You have to compile it yourself - this is for security so that everyone doesn't implement the exact same security.
看看:
您永远不应该使用其他人提供的静态模块。永远建立自己的。
You should never use a static module provided by someone else. Always build your own.
苹果官方解释 - 在OpenSSl下 -
Apples official explanation here - under OpenSSl - https://developer.apple.com/library/ios/documentation/Security/Conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html
这篇关于如何将openssl添加到swift项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!