Example #1
0
 public function processData($arr)
 {
     //		echo "\n!!! IN signSpkac() !!!\n";
     unset($arr["sub"]);
     require_once "COpenSslApiImpl_class.php";
     $opensslObj = new COpenSslApiImpl();
     $res = $opensslObj->genCrl($arr['conf_path'], $arr['ca_sec_name'], $arr['rootcert_path'], $arr['rootcert_key_path'], $arr['rootcert_key_pass'], $arr['crl_path'], $arr['crl_days'], $arr['md']);
     if ($res == 1) {
         return "Error in CRL generating command...";
     } elseif ($res == false) {
         return "Error in configuration or paths : (";
     } else {
         return "Success!<BR><BR>{$res}";
     }
     return $ret_str;
 }
Example #2
0
 public function processData($arr)
 {
     //		echo "\n!!! IN signSpkac() !!!\n";
     unset($arr["sub"]);
     require_once "COpenSslApiImpl_class.php";
     $opensslObj = new COpenSslApiImpl();
     $res = $opensslObj->signSpkac($arr['conf_path'], $arr['ca_sec_name'], $arr['rootcert_path'], $arr['rootcert_key_path'], $arr['rootcert_key_pass'], $arr['spkacfile_path'], $arr['outcerts_path'], $arr['user_outcerts_path'], $arr['days'], $arr['md'], $arr['pol_sec'], $arr['user_id'], $arr['ext_sec_name']);
     if ($res == 1) {
         $ret_str = "Error in spkac signing command...";
     } else {
         if (empty($res)) {
             $ret_str = "Error in configuration or paths when signing SPKAC : (";
         } else {
             $ret_str = $res;
             require_once 'nusoap.php';
             $url = "http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']);
             $pathClient = new nusoap_client("{$url}/CPathSoapServer.php");
             $signed_spkac_path = $pathClient->call('CPath.getPath', array('pathName' => "SignedSpkacsFolderPath")) . '/' . basename($arr['spkacfile_path']);
             if (rename($arr['spkacfile_path'], $signed_spkac_path) == FALSE) {
                 die("Oops, an error occured while moving signed spkac file...");
             } else {
                 $ret_str .= "\nSPKAC file moved.";
             }
         }
     }
     return $ret_str;
 }
<?php

if (isset($_GET["spkac_path"])) {
    $spkac_path = $_GET["spkac_path"];
    require_once "COpenSslApiImpl_class.php";
    $opensslObj = new COpenSslApiImpl();
    $text = $opensslObj->getSpkacText($spkac_path);
    $text .= "\n" . strstr(file_get_contents($spkac_path), "\n");
    echo $text;
}
Example #4
0
 public function processData($arr)
 {
     //		echo "\n!!! IN createRootCa() !!!\n";
     unset($arr["sub"]);
     require_once "COpenSslApiImpl_class.php";
     $opensslObj = new COpenSslApiImpl();
     $res = $opensslObj->genSsCert($arr["conf_path"], $arr["key_len"], $arr["cert_path"], $arr["key_path"], $arr["pass"], $arr["subject"], $arr["days"], $arr["md"], $arr["ext_name"]);
     if ($res == 1) {
         return "Error in certificate generating command...";
     } elseif ($res == false) {
         return "Error in configuration or paths : (";
     } else {
         return "Success!<BR><BR>{$res}";
     }
 }