OpenSSL on iPhone

前端 未结 3 1031
伪装坚强ぢ
伪装坚强ぢ 2020-12-18 10:03

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

相关标签:
3条回答
  • 2020-12-18 10:37

    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.

    0 讨论(0)
  • 2020-12-18 10:37

    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/

    0 讨论(0)
  • 2020-12-18 10:49

    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]
    
    0 讨论(0)
提交回复
热议问题