English 中文(简体)
OpenSSL on iPhone
原标题:

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.

问题回答

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.

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/

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]




相关问题
Natural language rendering

Do you know any frameworks that implement natural language rendering concept ? I ve found several NLP oriented frameworks like Anthelope or Open NLP but they have only parsers but not renderers or ...

PHP Framework: Ebay Like Site

I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...

Why does stack get truncated in Exception.StackTrace?

Why does the high part of the stack (in Exception.StackTrace) gets truncated? Let s see a simple example: public void ExternalMethod() { InternalMethod(); } public void InternalMethod() { try ...

Finding the correct Python framework with cmake

I am using the macports version of python on a Snow Leopard computer, and using cmake to build a cross-platform extension to it. I search for the python interpreter and libraries on the system using ...

edit profile from frontend - symfony

I succeeded to create a register form, and now users can register my site. But I can t create a form where users can edit their profile. I have sf_guard_user and sf_guard_user_profile in my schema....

MVC evolution and improvements

I just found the MVC was initially proposed in 88 [here is the pdf file] but unfortunately ASP.NET just recently implement it. Do you know which is the most used MVC design pattern in the our days ...

热门标签