Refactor config.useWebCrypto to config.useNative
This commit is contained in:
parent
5358c6f9fe
commit
55bd9757e7
|
@ -29,6 +29,8 @@
|
||||||
* @module config/config
|
* @module config/config
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var enums = require('../enums.js');
|
var enums = require('../enums.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -40,8 +42,7 @@ module.exports = {
|
||||||
// fail on decrypt if message is not integrity protected
|
// fail on decrypt if message is not integrity protected
|
||||||
ignore_mdc_error: false,
|
ignore_mdc_error: false,
|
||||||
rsa_blinding: true,
|
rsa_blinding: true,
|
||||||
useWebCrypto: true,
|
useNative: true, // use native node.js crypto and Web Crypto apis (if available)
|
||||||
useNative: false, // Node crypto library for AES
|
|
||||||
|
|
||||||
show_version: true,
|
show_version: true,
|
||||||
show_comment: true,
|
show_comment: true,
|
||||||
|
|
|
@ -396,11 +396,11 @@ module.exports = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get native Web Cryptography api. The default configuration is to use
|
* 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'
|
* @return {Object} The SubtleCrypto api or 'undefined'
|
||||||
*/
|
*/
|
||||||
getWebCrypto: function() {
|
getWebCrypto: function() {
|
||||||
if (config.useWebCrypto === false) {
|
if (!config.useNative) {
|
||||||
// make web crypto optional
|
// make web crypto optional
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user