VALIDAR CLAVE # openssl pkey -in certificado_kit.cer -text -passin pass:84665c168490988d33d4b1ded2f5edf5b4957784498 LEER INFORMACION # openssl x509 -in certificado_kit.cer -text BUSCAR RUC # openssl x509 -in certificado_kit.cer -text | grep 844084-1-504061
---------------------- Ejemplo PHP ---------------------- $datos['clave']='clave certificado p12'; $datos['cer']='certificado p12 en base64'; //PRODUCCION $url="https://panel.siteck.mx/panel/clavesdk/api.php"; //PRUEBAS // $url="https://pruebaspanel.siteck.mx/panel/clavesdk/api.php"; $respuesta=callAPI('POST', $url, $datos); //regresa nuevo certificado y su clave print_r($respuesta); /////////////////////////////////////////////////////////////////// function callAPI($method, $url, $data){ $curl = curl_init(); $options = array( CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => false, // follow redirects CURLOPT_MAXREDIRS => 1, // stop after 10 redirects CURLOPT_ENCODING => "", // handle compressed CURLOPT_USERAGENT => "api-mf", // name of client CURLOPT_AUTOREFERER => true, // set referrer on redirect CURLOPT_CONNECTTIMEOUT => 10, // time-out on connect CURLOPT_TIMEOUT => 10, // time-out on response ); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt_array($curl, $options); switch ($method){ case "POST": curl_setopt($curl, CURLOPT_POST, 1); if ($data) curl_setopt($curl, CURLOPT_POSTFIELDS, $data); break; case "PUT": curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT"); if ($data) curl_setopt($curl, CURLOPT_POSTFIELDS, $data); break; default: if ($data) $url = sprintf("%s?%s", $url, http_build_query($data)); } // OPTIONS: curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'APIKEY: 111111111111111111111', 'test-test: application/json', )); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); // EXECUTE: $result = curl_exec($curl); if(!$result){die("Connection Failure");} curl_close($curl); return $result; }