Certificationauthority.php : phpstan valid in level 6

This commit is contained in:
2022-10-14 21:01:23 +02:00
parent 3ba6c5435a
commit 6c9d624d81

View File

@@ -113,7 +113,7 @@ extendedKeyUsage = serverAuth, clientAuth
/** Get/Set the ca cert /** Get/Set the ca cert
* @param string|null $caCert The CA cert to get/set * @param string|null $caCert The CA cert to get/set
* @return (string|self if caCert = null) the CA if get in PEM, $this if set * @return ($caCert is null ? string : $this) the CA if get in PEM, $this if set
*/ */
public function caCert ($caCert = null) public function caCert ($caCert = null)
{ {
@@ -127,7 +127,7 @@ extendedKeyUsage = serverAuth, clientAuth
/** Get/Set the ca key /** Get/Set the ca key
* @param string|null $caKey The CA key to get/set * @param string|null $caKey The CA key to get/set
* @return (string|self if caKey = null) the CA if get, $this if set * @return ($caKey is null ? string : $this) the CA if get, $this if set
*/ */
public function caKey ($caKey = null) public function caKey ($caKey = null)
{ {
@@ -154,7 +154,7 @@ extendedKeyUsage = serverAuth, clientAuth
/** Get in PEM/Set the private key /** Get in PEM/Set the private key
* @param string|null $privateKey The private key to use * @param string|null $privateKey The private key to use
* @return (string|self if $privateKey = null) the privatekey if get in PEM, $this if set * @return ($privateKey is null ? string : $this) the privatekey if get in PEM, $this if set
*/ */
public function privateKey ($privateKey = null) public function privateKey ($privateKey = null)
{ {
@@ -229,7 +229,7 @@ extendedKeyUsage = serverAuth, clientAuth
} }
$this->configargs["x509_extensions"] = "v3_req"; $this->configargs["x509_extensions"] = "v3_req";
$usercert = openssl_csr_sign ($csr, $caCert, $caKey, $days, $usercert = openssl_csr_sign ($csr, $caCert, $caKey, $days,
$this->configargs, date ("YmdHis")); $this->configargs, intval(date ("YmdHis")));
if ($usercert === false) if ($usercert === false)
throw new \Exception ("Can not create certificate : " . throw new \Exception ("Can not create certificate : " .
openssl_error_string (), 500); openssl_error_string (), 500);