Эх сурвалжийг харах

2023-01-09 / ct_chen

Actions:
1. only change V2G cetificate from "backend" to "charging", others still in "backend"

Files:
1. EVSE/Modularization/WebService.c
   EVSE/rootfs/var/www/set_backend.php
   EVSE/rootfs/var/www/set_backend_action.php
   EVSE/rootfs/var/www/set_charging.php
   EVSE/rootfs/var/www/set_charging_action.php
ct_chen 2 жил өмнө
parent
commit
8701e66a3b

+ 81 - 80
EVSE/Modularization/WebService.c

@@ -1975,14 +1975,9 @@ int main(int argc, char *argv[]) {
 		struct json_object *isCalibratedPa[3];
 		struct json_object *isCalibratedPb[3];
 		struct json_object *isCalibratedPc[3];
-		struct json_object *ChargePointPrivateKey;
-		struct json_object *ChargePointCertificate;
 		struct json_object *V2GPrivateKey;
 		struct json_object *V2GRootCertificate;
 		struct json_object *V2GCertificateChain;
-		struct json_object *MORootCertificate;
-		struct json_object *CSRootCertificate;
-		struct json_object *ManufacturerRootCertificate;
 		/* for DO & DD*/
 		struct json_object *DDChargingInfo1;
 		struct json_object *DDChargingInfo2;
@@ -2068,6 +2063,11 @@ int main(int argc, char *argv[]) {
 		struct json_object *PowerSharingServerIP;
 		struct json_object *OcppReceiptrURL;
 		struct json_object *MaintainServerURL;
+		struct json_object *ChargePointPrivateKey;
+		struct json_object *ChargePointCertificate;
+		struct json_object *MORootCertificate;
+		struct json_object *CSRootCertificate;
+		struct json_object *ManufacturerRootCertificate;
 		/*for TTIA*/
 		struct json_object *isEnableTTIA;
 		struct json_object *server_addr;
@@ -2719,34 +2719,6 @@ int main(int argc, char *argv[]) {
 		//V2G certificate
 		FILE *file;
 		char line[0];
-		ChargePointPrivateKey = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					ChargePointPrivateKey = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
-		ChargePointCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					ChargePointCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
 		V2GPrivateKey = json_object_new_string("");
 		file = popen("sha256sum /Storage/certV2G.key", "r");
 		if (NULL != file)
@@ -2789,48 +2761,6 @@ int main(int argc, char *argv[]) {
 			}
 		}
 		pclose(file);
-		MORootCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/rootCaMo.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					MORootCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
-		CSRootCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					CSRootCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
-		ManufacturerRootCertificate = json_object_new_string("");
-		file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
-		if (NULL != file)
-		{
-			int i=0;
-			while (fgets(line, 65, file) != NULL)
-			{
-				if(i==0){
-					ManufacturerRootCertificate = json_object_new_string(line);
-				}
-				i++;
-			}
-		}
-		pclose(file);
 		//network
 		InternetConn = json_object_new_int(ShmSysConfigAndInfo->SysInfo.InternetConn);
 		FtpServer = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.FtpServer);
@@ -2913,6 +2843,77 @@ int main(int argc, char *argv[]) {
 			TTIAChargeBoxId = json_object_new_int(ShmSysConfigAndInfo->SysConfig.TTIA_Info.ChargeBoxId);
 			evseStation = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.TTIA_Info.evseStation);
 		}
+		//PnC certificate
+		ChargePointPrivateKey = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/certCP.key", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					ChargePointPrivateKey = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		ChargePointCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/certCP.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					ChargePointCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		MORootCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/rootCaMo.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					MORootCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		CSRootCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/rootCaCs.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					CSRootCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
+		ManufacturerRootCertificate = json_object_new_string("");
+		file = popen("sha256sum /Storage/OCPP/rootCaMf.pem", "r");
+		if (NULL != file)
+		{
+			int i=0;
+			while (fgets(line, 65, file) != NULL)
+			{
+				if(i==0){
+					ManufacturerRootCertificate = json_object_new_string(line);
+				}
+				i++;
+			}
+		}
+		pclose(file);
 
 		//system
 		json_object_object_add(jobj1,"ModelName",ModelName);
@@ -3276,14 +3277,9 @@ int main(int argc, char *argv[]) {
 				json_object_object_add(jobj2,"DDChargingInfo4",DDChargingInfo4);
 			}
 		}
-		json_object_object_add(jobj2,"ChargePointPrivateKey",ChargePointPrivateKey);
-		json_object_object_add(jobj2,"ChargePointCertificate",ChargePointCertificate);
 		json_object_object_add(jobj2,"V2GPrivateKey",V2GPrivateKey);
 		json_object_object_add(jobj2,"V2GRootCertificate",V2GRootCertificate);
 		json_object_object_add(jobj2,"V2GCertificateChain",V2GCertificateChain);
-		json_object_object_add(jobj2,"MORootCertificate",MORootCertificate);
-		json_object_object_add(jobj2,"CSRootCertificate",CSRootCertificate);
-		json_object_object_add(jobj2,"ManufacturerRootCertificate",ManufacturerRootCertificate);
 		printf("%s\n", json_object_to_json_string(jobj2));
 		json_object_put(jobj2);
 
@@ -3373,6 +3369,11 @@ int main(int argc, char *argv[]) {
 			json_object_object_add(jobj4,"TTIAChargeBoxId",TTIAChargeBoxId);
 			json_object_object_add(jobj4,"evseStation",evseStation);
 		}
+		json_object_object_add(jobj4,"ChargePointPrivateKey",ChargePointPrivateKey);
+		json_object_object_add(jobj4,"ChargePointCertificate",ChargePointCertificate);
+		json_object_object_add(jobj4,"MORootCertificate",MORootCertificate);
+		json_object_object_add(jobj4,"CSRootCertificate",CSRootCertificate);
+		json_object_object_add(jobj4,"ManufacturerRootCertificate",ManufacturerRootCertificate);
 
 		printf("%s\n", json_object_to_json_string(jobj4));
 		json_object_put(jobj4);

+ 64 - 0
EVSE/rootfs/var/www/set_backend.php

@@ -258,6 +258,38 @@ CORE STYLES ABOVE - NO TOUCHY
 											<label><?php echo $lang->showWord("ocpp_security_password"); ?></label>
 											<input type="text" name="OcppSecurityPassword" id="OcppSecurityPassword" class="form-control" value="<?php echo htmlspecialchars($obj->{'OcppSecurityPassword'});?>">
 										</div>
+										<div id="TLSwithClientSideCertificatesDiv" class="form-group file-upload" style="display:<?php echo $am101;?>">
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("private_key_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'ChargePointPrivateKey'})>0?$obj->{'ChargePointPrivateKey'}:'File not found'?>)</font></label>
+												<div class="file-loading">
+													<input name="private_key" id="private_key" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".key">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("certificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'ChargePointCertificate'})>0?$obj->{'ChargePointCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="certificate" id="certificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("MORootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'MORootCertificate'})>0?$obj->{'MORootCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="MORootCertificate" id="MORootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("CSRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'CSRootCertificate'})>0?$obj->{'CSRootCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="CSRootCertificate" id="CSRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+											<div class="file-upload">
+												<label><?php echo $lang->showWord("ManufacturerRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj->{'ManufacturerRootCertificate'})>0?$obj->{'ManufacturerRootCertificate'}:"File not found"?>)</font></label>
+												<div class="file-loading">
+													<input name="ManufacturerRootCertificate" id="ManufacturerRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
+												</div>
+											</div>
+										</div>
 <?php if(substr($ModelName,0,2)=="AX" || substr($ModelName,0,2)=="AW" || substr($ModelName,0,1)=="D"){?>
 										<div class="form-group" style="display:block">
 											<label><?php echo $lang->showWord("ocpp_receipt_url"); ?></label>
@@ -391,6 +423,31 @@ CORE STYLES ABOVE - NO TOUCHY
 
 			// POST 參數須使用 send() 發送
 			var formData = new FormData();
+			if(document.getElementById("private_key").value != ""){
+				var fileInput = document.getElementById('private_key');
+				var file = fileInput.files[0];
+				formData.append("private_key", file);
+			}
+			if(document.getElementById("certificate").value != ""){
+				var fileInput = document.getElementById('certificate');
+				var file = fileInput.files[0];
+				formData.append("certificate", file);
+			}
+			if(document.getElementById("MORootCertificate").value != ""){
+				var fileInput = document.getElementById('MORootCertificate');
+				var file = fileInput.files[0];
+				formData.append("MORootCertificate", file);
+			}
+			if(document.getElementById("CSRootCertificate").value != ""){
+				var fileInput = document.getElementById('CSRootCertificate');
+				var file = fileInput.files[0];
+				formData.append("CSRootCertificate", file);
+			}
+			if(document.getElementById("ManufacturerRootCertificate").value != ""){
+				var fileInput = document.getElementById('ManufacturerRootCertificate');
+				var file = fileInput.files[0];
+				formData.append("ManufacturerRootCertificate", file);
+			}
 			formData.append("BackendConnTimeout", document.getElementById("BackendConnTimeout").value);
 			formData.append("OfflinePolicy", document.getElementById("OfflinePolicy").value);
 			formData.append("OfflineMaxChargeEnergy", document.getElementById("OfflineMaxChargeEnergy").value);
@@ -532,9 +589,16 @@ CORE STYLES ABOVE - NO TOUCHY
 	function OcppSecurityProfile_changed(){
 		if(document.getElementById("OcppSecurityProfile").value == "1" || document.getElementById("OcppSecurityProfile").value == "2" || document.getElementById("OcppSecurityProfile").value == "3"){
 			document.getElementById("OcppSecurityPasswordDiv").style.display="block";
+			if(document.getElementById("OcppSecurityProfile").value == "3"){
+				document.getElementById("TLSwithClientSideCertificatesDiv").style.display="block";
+			}
+			else{
+				document.getElementById("TLSwithClientSideCertificatesDiv").style.display="none";
+			}
 		}
 		else{
 			document.getElementById("OcppSecurityPasswordDiv").style.display="none";
+			document.getElementById("TLSwithClientSideCertificatesDiv").style.display="none";
 		}
 	}
 	function MaintainServerSecurityProfile_changed(){

+ 90 - 0
EVSE/rootfs/var/www/set_backend_action.php

@@ -116,6 +116,96 @@
 			checkLength("evseStation",15);
 			$json['evseStation']				= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['evseStation'])))));
 		}
+		$fCount = empty($_FILES['private_key']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["private_key"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["private_key"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl rsa -noout -modulus -in '.$_FILES['private_key']['name']),"Modulus")===false){	//unable to load Private Key
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of Private Key is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["private_key"]["tmp_name"],"/Storage/OCPP/certCP.key");
+		}
+		$fCount = empty($_FILES['certificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["certificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["certificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['certificate']['name']),"Modulus")===false){	//unable to load certificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["certificate"]["tmp_name"],"/Storage/OCPP/certCP.pem");
+		}
+		$fCount = empty($_FILES['MORootCertificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["MORootCertificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["MORootCertificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['MORootCertificate']['name']),"Modulus")===false){	//unable to load MORootCertificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of MO Root Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["MORootCertificate"]["tmp_name"],"/Storage/rootCaMo.pem");
+		}
+		$fCount = empty($_FILES['CSRootCertificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["CSRootCertificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["CSRootCertificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['CSRootCertificate']['name']),"Modulus")===false){	//unable to load CSRootCertificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of CS Root Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["CSRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaCs.pem");
+		}
+		$fCount = empty($_FILES['ManufacturerRootCertificate']['tmp_name'][0]);
+		if($fCount!=1){
+			if ($_FILES["ManufacturerRootCertificate"]["error"] > 0)
+			{
+				$jsone['result'] = "Error";
+				$jsone['message'] = $_FILES["ManufacturerRootCertificate"]["error"];
+				echo json_encode($jsone);
+				exit;
+			}
+			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['ManufacturerRootCertificate']['name']),"Modulus")===false){	//unable to load ManufacturerRootCertificate
+				$jsone['result'] = "Error";
+				$jsone['message'] = "format of Manufacturer Root Certificate is incorrect";
+				echo json_encode($jsone);
+				exit;
+			}
+			sleep(1);
+			move_uploaded_file($_FILES["ManufacturerRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaMf.pem");
+		}
 //		ob_start();
 		
 		shell_exec('sync;sync;sync');

+ 0 - 55
EVSE/rootfs/var/www/set_charging.php

@@ -2088,18 +2088,6 @@ CORE STYLES ABOVE - NO TOUCHY
 									<header>V2G Certificate<i class="fa fa-plus"></i></header>
 									<section>
 										<div id="TLSwithClientSideCertificatesDiv" class="form-group file-upload">
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("private_key_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['ChargePointPrivateKey'])>0?$obj['ChargePointPrivateKey']:'File not found'?>)</font></label>
-												<div class="file-loading">
-													<input name="private_key" id="private_key" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".key">
-												</div>
-											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("certificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['ChargePointCertificate'])>0?$obj['ChargePointCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="certificate" id="certificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
 											<div class="file-upload">
 												<label><?php echo $lang->showWord("V2GPrivateKey_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['V2GPrivateKey'])>0?$obj['V2GPrivateKey']:'File not found'?>)</font></label>
 												<div class="file-loading">
@@ -2118,24 +2106,6 @@ CORE STYLES ABOVE - NO TOUCHY
 													<input name="V2GCertificateChain" id="V2GCertificateChain" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
 												</div>
 											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("MORootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['MORootCertificate'])>0?$obj['MORootCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="MORootCertificate" id="MORootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("CSRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['CSRootCertificate'])>0?$obj['CSRootCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="CSRootCertificate" id="CSRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
-											<div class="file-upload">
-												<label><?php echo $lang->showWord("ManufacturerRootCertificate_file"); ?> sha256 hash: <font color="#ff0000">(<?php echo strlen($obj['ManufacturerRootCertificate'])>0?$obj['ManufacturerRootCertificate']:"File not found"?>)</font></label>
-												<div class="file-loading">
-													<input name="ManufacturerRootCertificate" id="ManufacturerRootCertificate" type="file" class="file" data-show-preview="false" data-show-upload="false" accept=".pem">
-												</div>
-											</div>
 										</div>
 									</section>
 								</article>
@@ -2289,16 +2259,6 @@ CORE STYLES ABOVE - NO TOUCHY
 
 			// POST 參數須使用 send() 發送
 			var formData = new FormData();
-			if(document.getElementById("private_key").value != ""){
-				var fileInput = document.getElementById('private_key');
-				var file = fileInput.files[0];
-				formData.append("private_key", file);
-			}
-			if(document.getElementById("certificate").value != ""){
-				var fileInput = document.getElementById('certificate');
-				var file = fileInput.files[0];
-				formData.append("certificate", file);
-			}
 			if(document.getElementById("V2GPrivateKey").value != ""){
 				var fileInput = document.getElementById('V2GPrivateKey');
 				var file = fileInput.files[0];
@@ -2314,21 +2274,6 @@ CORE STYLES ABOVE - NO TOUCHY
 				var file = fileInput.files[0];
 				formData.append("V2GCertificateChain", file);
 			}
-			if(document.getElementById("MORootCertificate").value != ""){
-				var fileInput = document.getElementById('MORootCertificate');
-				var file = fileInput.files[0];
-				formData.append("MORootCertificate", file);
-			}
-			if(document.getElementById("CSRootCertificate").value != ""){
-				var fileInput = document.getElementById('CSRootCertificate');
-				var file = fileInput.files[0];
-				formData.append("CSRootCertificate", file);
-			}
-			if(document.getElementById("ManufacturerRootCertificate").value != ""){
-				var fileInput = document.getElementById('ManufacturerRootCertificate');
-				var file = fileInput.files[0];
-				formData.append("ManufacturerRootCertificate", file);
-			}
 			formData.append("MaxChargingEnergy", document.getElementById("MaxChargingEnergy").value);
 			formData.append("MaxChargingPower", document.getElementById("MaxChargingPower").value);
 			formData.append("MaxChargingCurrent", document.getElementById("MaxChargingCurrent").value);

+ 0 - 90
EVSE/rootfs/var/www/set_charging_action.php

@@ -177,42 +177,6 @@
 		}
 		exec('openssl rsa -noout -modulus -in /var/www/private.key');
 		exec('openssl x509 -noout -modulus -in /var/www/cacert.pem');
-		$fCount = empty($_FILES['private_key']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["private_key"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["private_key"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl rsa -noout -modulus -in '.$_FILES['private_key']['name']),"Modulus")===false){	//unable to load Private Key
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of Private Key is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["private_key"]["tmp_name"],"/Storage/OCPP/certCP.key");
-		}
-		$fCount = empty($_FILES['certificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["certificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["certificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['certificate']['name']),"Modulus")===false){	//unable to load certificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["certificate"]["tmp_name"],"/Storage/OCPP/certCP.pem");
-		}
 		$fCount = empty($_FILES['V2GPrivateKey']['tmp_name'][0]);
 		if($fCount!=1){
 			if ($_FILES["V2GPrivateKey"]["error"] > 0)
@@ -267,60 +231,6 @@
 			sleep(1);
 			move_uploaded_file($_FILES["V2GCertificateChain"]["tmp_name"],"/Storage/certV2g.pem");
 		}
-		$fCount = empty($_FILES['MORootCertificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["MORootCertificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["MORootCertificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['MORootCertificate']['name']),"Modulus")===false){	//unable to load MORootCertificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of MO Root Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["MORootCertificate"]["tmp_name"],"/Storage/rootCaMo.pem");
-		}
-		$fCount = empty($_FILES['CSRootCertificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["CSRootCertificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["CSRootCertificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['CSRootCertificate']['name']),"Modulus")===false){	//unable to load CSRootCertificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of CS Root Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["CSRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaCs.pem");
-		}
-		$fCount = empty($_FILES['ManufacturerRootCertificate']['tmp_name'][0]);
-		if($fCount!=1){
-			if ($_FILES["ManufacturerRootCertificate"]["error"] > 0)
-			{
-				$jsone['result'] = "Error";
-				$jsone['message'] = $_FILES["ManufacturerRootCertificate"]["error"];
-				echo json_encode($jsone);
-				exit;
-			}
-			else if(strpos(exec('openssl x509 -noout -modulus -in '.$_FILES['ManufacturerRootCertificate']['name']),"Modulus")===false){	//unable to load ManufacturerRootCertificate
-				$jsone['result'] = "Error";
-				$jsone['message'] = "format of Manufacturer Root Certificate is incorrect";
-				echo json_encode($jsone);
-				exit;
-			}
-			sleep(1);
-			move_uploaded_file($_FILES["ManufacturerRootCertificate"]["tmp_name"],"/Storage/OCPP/rootCaMf.pem");
-		}
 //		ob_start();
 		
 		shell_exec('sync;sync;sync');