Need Helpo with Php Script need to generate a CA Certificate
Budget: $10 – $30 USD
Need Helpo with Php Script need to generate a CA Certificate
the server need a valid certificate
this is the code
function certificate_validity(){
$csn=exec("vol c:");
$csn=substr($csn,strlen($csn)-9,9);
if($cer=file_get_contents('unitypos_cert.cer')){
$data = openssl_x509_parse($cer);
$valid_from=date('Y-m-d', $data['validFrom_time_t']);
$valid_to=date('Y-m-d', $data['validTo_time_t']);
$csn_cer=substr($data['subject']['CN'],0,9);
$type=substr($data['subject']['CN'],10,strlen($data['subject']['CN'])-10);
$pubkeyid = openssl_pkey_get_public($cer);
$sign=file_get_contents('unitypos_signature.sign');
$today=date('Y-m-d');
$validate=openssl_verify($cer,$sign,$pubkeyid,"SHA512");
if($validate&&$today<$valid_to&&$today>=$valid_from&&$csn==$csn_cer&&$type==="unitypos"){
return true;
}
else{
return false;
}
the server need a valid certificate
this is the code
function certificate_validity(){
$csn=exec("vol c:");
$csn=substr($csn,strlen($csn)-9,9);
if($cer=file_get_contents('unitypos_cert.cer')){
$data = openssl_x509_parse($cer);
$valid_from=date('Y-m-d', $data['validFrom_time_t']);
$valid_to=date('Y-m-d', $data['validTo_time_t']);
$csn_cer=substr($data['subject']['CN'],0,9);
$type=substr($data['subject']['CN'],10,strlen($data['subject']['CN'])-10);
$pubkeyid = openssl_pkey_get_public($cer);
$sign=file_get_contents('unitypos_signature.sign');
$today=date('Y-m-d');
$validate=openssl_verify($cer,$sign,$pubkeyid,"SHA512");
if($validate&&$today<$valid_to&&$today>=$valid_from&&$csn==$csn_cer&&$type==="unitypos"){
return true;
}
else{
return false;
}