How to use the fabric-common.Utils.normalizeX509 function in fabric-common

To help you get started, we’ve selected a few fabric-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hyperledger / fabric-sdk-node / fabric-client / lib / impl / NetworkConfig_1_0.js View on Github external
function getPEMfromConfig(config, network_config_loc) {
	let result = null;
	if (config) {
		if (config[PEM]) {
			// cert value is directly in the configuration
			result = config[PEM];
		} else if (config[PATH]) {
			// cert value is in a file
			result = readFileSync(config[PATH], network_config_loc);
			result = utils.normalizeX509(result);
		}
	}

	return result;
}