resCode == 0 || $Ret->resCode == -2147483648 /* Result::Succeeded */) { // The resCode was Unknow or Succedded so lets look at the other codes // Set the reCode to succes so it's not used below. $Ret->resCode = -2147483648; if( $Ret->caCertRes == 1 && $Ret->certRes == 1 ) { // The files were so bad we did not even get to the validate. // So set both files as corrupted. error_log("Root certificate ". $_FILES['rootCert']['name'] . " and Client certificate ".$_FILES['clientCert']['name'] .""); $returnMessage="Root and client certificate failed to validate."; } else if( $Ret->caCertRes != -2147483648 ) // Result::Succeeded) { error_log("Root certificate: ".$_FILES['rootCert']['name']); $returnMessage="Root certificate failed to validate."; } else if($Ret->certRes != -2147483648 ) // Result::Succeeded) { error_log("Client certificate: ".$_FILES['clientCert']['name']); $returnMessage="Client certificate failed to validate."; } else { error_log("****************** Running akm_install_cert with $Root, 8, null password **********************\n"); $iRet = akm_install_cert($user, $Root, 8, "" ); if( $iRet == 0 ) { error_log("Certificate imported."); error_log("****************** Running akm_install_cert with $fileName, $fileType, $password **********************\n"); $iRet = akm_install_cert($user, $fileName, $fileType, $password ); if( $iRet == 0 ) { error_log("Client Certificate imported."); $returnMessage = "Communication certificates have been successfully imported."; } else { error_log("Problem Importing Client Certificate"); $returnMessage="Problem Importing Client Certificate"; } } else { error_log("Problem Importing Root Certificate"); $returnMessage="Problem Importing Root Certificate"; } } } } ?> Communication certificate import