Configure FIPS 140-2 mode for HTTPS and JSONStore encryption
Learn about settings to configure FIPS 140-2 for encrypting data for HTTPS and JSONStore.
The following code snippet is populated into a new IBM MobileFirst Platform Foundation application in the initOptions.js file for configuring FIPS 140-2:
var wlInitOptions = { ... // # Enable FIPS 140-2 for data-in-motion (network) and data-at-rest (JSONStore) on iOS or Android. // Requires the FIPS 140-2 optional feature to be enabled also. // enableFIPS : false ... };Notice the default value of enableFIPS is false. To enable FIPS 140-2 for both HTTPS and JSONStore data encryption, uncomment and set the option to true. After you set the value of enableFIPS to true, you should listen for the FIPS ready JavaScript event.
The following example assumes that you are using jQuery 1.7 or later, or WLJQ (jQuery that is included with MPF).
$(document).on('WL/FIPS/READY', function(evt, obj) { //evt - Contains information about the event //obj - JavaScript object sent after the attempt to enable FIPS completes // if successfully enabled, object will be {enabled: true} // if enablement failed, object will be {enabled: false, msg: "message // indicating cause of the failure to enable"} });After you set the value of the enableFIPS property, create an Android, iPhone, or iPad environment, and build those environments.
We must enable the FIPS 140-2 optional feature before you set the enableFIPS property to true. Otherwise, a warning message is logged that states the initOption value is set but the optional feature was not found. The FIPS 140-2 and JSONStore features are both optional. FIPS 140-2 affects JSONStore data encryption only if the JSONStore optional feature is also enabled. If JSONStore is not enabled, then FIPS 140-2 does not affect JSONStore.
[WARN] FIPSHttp feature not found, but initOptions enables it on startup
For more information about installing the FIPS 140-2 optional feature, see Enable FIPS 140-2.
Parent topic: FIPS 140-2 support