Refactor config.useWebCrypto to config.useNative

This commit is contained in:
Tankred Hase 2016-02-03 11:39:06 +07:00
parent 5358c6f9fe
commit 55bd9757e7
2 changed files with 5 additions and 4 deletions

View File

@ -29,6 +29,8 @@
* @module config/config
*/
'use strict';
var enums = require('../enums.js');
module.exports = {
@ -40,8 +42,7 @@ module.exports = {
// fail on decrypt if message is not integrity protected
ignore_mdc_error: false,
rsa_blinding: true,
useWebCrypto: true,
useNative: false, // Node crypto library for AES
useNative: true, // use native node.js crypto and Web Crypto apis (if available)
show_version: true,
show_comment: true,

View File

@ -396,11 +396,11 @@ module.exports = {
/**
* Get native Web Cryptography api. The default configuration is to use
* the api when available. But it can also be deactivated with config.useWebCrypto
* the api when available. But it can also be deactivated with config.useNative
* @return {Object} The SubtleCrypto api or 'undefined'
*/
getWebCrypto: function() {
if (config.useWebCrypto === false) {
if (!config.useNative) {
// make web crypto optional
return;
}