Enabling OpenSSL for Cordova iOS

The MobileFirst iOS SDK uses native iOS APIs for cryptography. You can configure the MobileFirst V8.0.0 to use the OpenSSL cryptography library in your Cordova iOS app.

The encryption/decryption functionalities are provided with the following Javascript APIs:

WL.SecurityUtils.encryptText

WL.SecurityUtils.decryptWithKey

Option 1: Native encryption/decryption

By default MobileFirst provides native encryption/decryption, without using OpenSSL. This is equivalent to explicitly setting the encryption/decryption behavior:

WL.SecurityUtils.enableNativeEncryption(true)

Option 2: Enabling OpenSSL

MobileFirst provided OpenSSL is disabled by default.

To install the necessary frameworks for supporting OpenSSL, first install the Cordova plug-in:

cordova plugin add cordova-plugin-mfp-encrypt-utils

The following code enables the OpenSSL option for the encryption/decryption:

WL.SecurityUtils.enableNativeEncryption(false)

With this setup, the encryption/decryption calls use OpenSSL as in previous versions of MobileFirst.

Migration options

If you have an IBM MobileFirst™ Platform Foundation project written in an earlier version, you may need to incorporate changes to continue using OpenSSL.