如何将openssl添加到swift项目中 [英] how to add openssl to a swift project

查看:778
本文介绍了如何将openssl添加到swift项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习如何在我的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.

看看:
https://gist.github.com/foozmeat/5154962
http://www.cvursache.com/2013/08/13/How-To-Build-openssl-For-iOS /

http://cocoapods.org/?q=openssl

您永远不应该使用其他人提供的静态模块。永远建立自己的。

You should never use a static module provided by someone else. Always build your own.

苹果官方解释 - 在OpenSSl下 - https://developer.apple.com/library/ios/documentation/Security/Conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html

Apples official explanation here - under OpenSSl - https://developer.apple.com/library/ios/documentation/Security/Conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html

这篇关于如何将openssl添加到swift项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆