The receipt validation code depends on OpenSSL 1.0.0+. Thus, the code needs to be statically or dynamically linked.

OpenSSL Licensing

The use of OpenSSL when linking statically requires to include these sentences in your application (in the Credits.rtf file for example):

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic software written by Eric Young (eay@cryptsoft.com).

One particular aspect of the OpenSSL project, is that the binaries are not distributed; only the sources are available.

So far, you have the following options:

  • build the binaries by yourself for each targeted platform: this is time-consuming and error-prone but it gives you a full control on what is built. The build script will build universal binaries of OpenSSL.
  • download a pre-built package: if you are unsure about what to do, this is the way to go.
  • use the MacPort project: execute the command sudo port install OpenSSL.
  • use the Cocoa pods: execute the command pod OpenSSL or pod OpenSSL-LET. Check out the CocoaPods website for more options.

If you don't have the time or the resources to build OpenSSL by your own, here is the latest build of the OpenSSL libraries:

The distribution includes the header files and the libcrypto and libssl static libraries, build as universal binaries for the i386, x86_64 architectures.

The distribution includes the header files and the libcrypto and libssl static libraries, build as universal binaries for the i386, x86_64, armv7, armv7s and arm64 architectures.

Install the OpenSSL headers and binaries at the place of your choice. For the rest of the guide, it will be located under /Users/Guest/Projects/openssl-1.0.1.

OS X and iOS

The procedure is the same for OS X and iOS, even if the following screenshots are OS X oriented.

In Xcode, go to the application's Build Settings. Select the All and Combined filters, then search for the user paths strings:

  • Change the Always Search User Paths option to Yes.
  • Add the /Users/Guest/Projects/openssl-1.0.1/include path to the User Header Search Paths option.

In Xcode, go to the application's Build Phases. Expand the Link Binary With Libraries phase. Click on the + button to add a new library.

Click on the Add other... button to select an external library.

Add the libcrypto.a file from the /Users/Guest/Projects/openssl-1.0.1/lib folder.

The libcrypto.a file is now listed in the linked binaries.