Refactor config.useWebCrypto to config.useNative
This commit is contained in:
parent
5358c6f9fe
commit
55bd9757e7
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user