How to integrate OpenSSL into AppCore

Hello all -

As a self-study, I am trying to integrate OpenSSL into AppCore per the instructions on GitHub here:


https://github.com/ResearchKit/AppCore


At the end of the OpenSSL section, the instructions state the following:

To re-enable OpenSSL, build OpenSSL as an iOS static library, add it to the AppCore library target, and then switch the CMS code to use OpenSSL by removing APCCMS_NoEncryption_JustAStub.m from the target and adding APCCMS_UsingOpenSSL.m instead.

I cannot find these files in the project. What am I missing? Also, I compiled OpenSSL for iOS per the instructions in the GitHub repository, but I am not sure how to combine the files into a static iOS library for inclusion in an app. Will some kind soul out there help this poor newbie?


Thanks so much.

Mike

Replies

This question was also posted to the ResearchKit developer list. Here is the answer that was posted to that list:


Those instructions are out of date. AppCore now looks for the existence of a specific class and method at runtime, and if available, calls that to do the encryption. The reference implementation of that class and method that we use for both the mPower and Share the Journey apps (shipping versions) is available (as open source) here: https://github.com/Sage-Bionetworks/CMSSupport


In addition to the instructions in the readme, you’ll need to embed both the CMSSupport and the openssl frameworks built by that project into your app. Also you should build it as a subproject of your app project, and not standalone, to make sure you get the right binaries in the libraries for your build (i.e. no i386 or x86_64 binaries for App Store builds).


Be forewarned that it builds openssl for several architectures (depending on whether you’re building a Debug or Release version) and each architecture takes several minutes to build, so it will appear that the compilation process has locked up for up to 20 minutes; it hasn’t, and it only has to build the openssl libraries once for each build configuration (and each time you archive, unfortunately) unless you clean build folders or delete the derived data for your app.


If you have any trouble using it, email me directly and I’ll help you get it up and running.


Erin Mounts Sage Bionetworks