iPhone 上的 OpenSSL

发布于 2024-08-11 01:20:08 字数 289 浏览 2 评论 0原文

我需要弄清楚如何为 iPhone 获取两个 OpenSSL 函数。我试图保留它,这样我就不需要另一个 dylib,因为我不想让苹果因为如此愚蠢的事情而拒绝我的申请。

无论如何,我有一个访问 API 的应用程序,而不是我的 API 之一,所以我无法真正更改它,而且,我不想让任何人知道我的公钥,或使用这个特定的“私有”API,所以我不能只制作一个 PHP 脚本服务器端,这会更容易,但它根本行不通。

我需要能够使用一些东西来密封 OpenSSL 中的请求,并在 OpenSSL 中对公钥进行编码。我有标题,但我似乎无法弄清楚任何事情。

I need to figure out how to get two OpenSSL functions for iPhone. I'm trying to keep it so I don't need another dylib, because I don't want Apple to reject my application for something so silly.

Anyways, I have an app that access an API, not one of my APIs, so I can't really change it, and also, I don't want anyone to know my public key, or use this specific 'private' api, so I can't just make a PHP script server side, which, would be easier, except that it just won't work out.

I need to be able to use something that will seal a request in OpenSSL, and also encode a public key in OpenSSL. I have the headers, and I can't seem to figure anything out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

維他命╮ 2024-08-18 01:20:08

一般来说,iPhone上加解密最简单的方法是Security.framework,而不是直接使用OpenSSL。

请参阅此处:

http://developer.apple.com/iphone/library/DOCUMENTATION/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208-SW9

底部的示例(清单 2-8、2-9 和 2-10)显示了 RSA-1024 密钥对的创建以及加密和解密。

通过使用不同的密钥,您可以控制加密/解密方法以满足服务器的要求。

Generally, the easiest approach to encryption and decryption on the iPhone is the Security.framework, instead of using OpenSSL directly.

See here:

http://developer.apple.com/iphone/library/DOCUMENTATION/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html#//apple_ref/doc/uid/TP40001358-CH208-SW9

The example at the bottom (listings 2-8, 2-9 and 2-10) show RSA-1024 key pair creation plus encryption and decryption.

By using a different key, you can control the encryption/decryption method to match the requirements of your server.

情释 2024-08-18 01:20:08

您还可以将 OpenSSL 编译为 iOS 库。这是我的教程:
http: //www.x2on.de/2010/07/13/tutorial-iphone-app-with-compiled-openssl-1-0-0a-library/

You can also compile OpenSSL as a library for iOS. Here is an tutorial from me:
http://www.x2on.de/2010/07/13/tutorial-iphone-app-with-compiled-openssl-1-0-0a-library/

舟遥客 2024-08-18 01:20:08

对我来说,我发现从 cocoapods 实现 OpenSSL pod 是最简单的。无需教程。
信息:http://cocoapods.org/?q=openssl

-> OpenSSL (1.0.1)
   OpenSSL is an SSL/TLS and Crypto toolkit. Deprecated in Mac OS and gone in iOS, this spec gives your project non-deprecated OpenSSL support.
   pod 'OpenSSL', '~> 1.0.1'
   - Homepage: http://www.openssl.org/
   - Source:   https://github.com/endSly/OpenSSL-pod.git
   - Versions: 1.0.1, 1.0.0 [master repo]

For me I found that implementing the OpenSSL pod from cocoapods was the easiest. No tutorial needed.
Info: http://cocoapods.org/?q=openssl

-> OpenSSL (1.0.1)
   OpenSSL is an SSL/TLS and Crypto toolkit. Deprecated in Mac OS and gone in iOS, this spec gives your project non-deprecated OpenSSL support.
   pod 'OpenSSL', '~> 1.0.1'
   - Homepage: http://www.openssl.org/
   - Source:   https://github.com/endSly/OpenSSL-pod.git
   - Versions: 1.0.1, 1.0.0 [master repo]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文