diff --git a/cmpOpenSSLTests.php b/cmpOpenSSLTests.php index 2bc2db1..f6321ee 100644 --- a/cmpOpenSSLTests.php +++ b/cmpOpenSSLTests.php @@ -26,7 +26,7 @@ $out = array(); - $x->createCA($parm, $out); + $x->cmpOpenSslCaGen($parm, $out); var_export($out); @@ -45,8 +45,8 @@ "organizationalUnitName" => "TEST-OIT" , ); - $x->loadFromFileCACrt("test-ca-01.crt"); - $x->loadFromFileCAPrv("test-ca-01.prv"); + $x->cmpOpenSslCaCertFromFile("test-ca-01.crt"); + $x->cmpOpenSslCaPrivFromFile("test-ca-01.prv"); $out = array(); @@ -69,8 +69,8 @@ "organizationalUnitName" => "TEST-OIT" , ); - $x->loadFromFileCACrt("test-ca-01.crt"); - $x->loadFromFileCAPrv("test-ca-01.prv"); + $x->cmpOpenSslCaCertFromFile("test-ca-01.crt"); + $x->cmpOpenSslCaPrivFromFile("test-ca-01.prv"); $out = array(); diff --git a/cmpOpenSSLTrait.php b/cmpOpenSSLTrait.php index da78b4b..6492bb5 100644 --- a/cmpOpenSSLTrait.php +++ b/cmpOpenSSLTrait.php @@ -289,7 +289,7 @@ return true; } - function getCertInfo($crt, $prv, &$out = null) { + function cmpOpenSslCertGetInfo($crt, $prv, &$out = null) { $txtPub = ""; $txtPrv = ""; @@ -392,7 +392,7 @@ return $out; } - function createCA($parm, &$out = null) { + function cmpOpenSslCaGen($parm, &$out = null) { try { $confFile = $this->cmpOpenSslConfTemp(); @@ -458,7 +458,7 @@ return NULL; } - $this->getCertInfo($this->caCrt, $this->caPrv, $out); + $this->cmpOpenSslCertGetInfo($this->caCrt, $this->caPrv, $out); $txtPub = ""; $txtPrv = ""; @@ -467,7 +467,7 @@ openssl_pkey_export($this->caPrv , $txtPrv, NULL ); if($out !== null) { - if(!$this->getCertInfo($this->caCrt, $this->caPrv, $out)) + if(!$this->cmpOpenSslCertGetInfo($this->caCrt, $this->caPrv, $out)) return NULL; } @@ -489,14 +489,14 @@ return true; } - function loadFromFileCACrt($file) { + function cmpOpenSslCaCertFromFile($file) { // var_dump(openssl_get_cert_locations()); $this->caCrtFile = $file; $text = @file_get_contents($file); - if($this->loadFromTextCACrt($text)) { + if($this->cmpOpenSslCaCertFromText($text)) { $this->caCrtFile = $file; return true; } @@ -504,7 +504,7 @@ return NULL; } - function loadFromTextCACrt($text) { + function cmpOpenSslCaCertFromText($text) { $this->caCrtFile = ""; $this->caCrtPEM = $text; @@ -550,12 +550,12 @@ return true; } - function loadFromFileCAPrv($file, $pass = NULL) { + function cmpOpenSslCaPrivFromFile($file, $pass = NULL) { $this->caPrvFile = $file; $text = @file_get_contents($file); - if($this->loadFromTextCAPrv($text, $pass)) { + if($this->cmpOpenSslCaPrivFromText($text, $pass)) { $this->caPrvFile = $file; return true; } @@ -563,7 +563,7 @@ return NULL; } - function loadFromTextCAPrv($text, $pass = NULL) { + function cmpOpenSslCaPrivFromText($text, $pass = NULL) { $this->caPrvFile = ""; /* if(@$file) @@ -692,7 +692,7 @@ openssl_pkey_export($this->cliPrv, $txtPrv, NULL ); if($out !== null) { - if(!$this->getCertInfo($this->cliCrt, $this->cliPrv, $out)) + if(!$this->cmpOpenSslCertGetInfo($this->cliCrt, $this->cliPrv, $out)) return NULL; }