mirror of
https://github.com/anikeen-com/yaac.git
synced 2026-03-23 02:17:48 +00:00
applied getOption
psr2 formatting
This commit is contained in:
@@ -138,11 +138,6 @@ class Client
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function getKeyLength(): int
|
||||
{
|
||||
return $this->config['key_length'] ?? 4096;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an existing order by ID
|
||||
*
|
||||
@@ -287,7 +282,7 @@ class Client
|
||||
* @return bool
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function validate(Challenge $challenge, $maxAttempts = 15): bool
|
||||
public function validate(Challenge $challenge, int $maxAttempts = 15): bool
|
||||
{
|
||||
$this->request(
|
||||
$challenge->getUrl(),
|
||||
@@ -321,7 +316,7 @@ class Client
|
||||
*/
|
||||
public function getCertificate(Order $order): Certificate
|
||||
{
|
||||
$privateKey = Helper::getNewKey($this->getKeyLength());
|
||||
$privateKey = Helper::getNewKey($this->getOption('key_length', 4096));
|
||||
$csr = Helper::getCsr($order->getDomains(), $privateKey);
|
||||
$der = Helper::toDer($csr);
|
||||
|
||||
@@ -498,7 +493,10 @@ class Client
|
||||
{
|
||||
//Make sure a private key is in place
|
||||
if ($this->getFilesystem()->has($this->getPath('account.pem')) === false) {
|
||||
$this->getFilesystem()->write($this->getPath('account.pem'), Helper::getNewKey($this->getKeyLength()));
|
||||
$this->getFilesystem()->write(
|
||||
$this->getPath('account.pem'),
|
||||
Helper::getNewKey($this->getOption('key_length', 4096))
|
||||
);
|
||||
}
|
||||
$privateKey = $this->getFilesystem()->read($this->getPath('account.pem'));
|
||||
$privateKey = openssl_pkey_get_private($privateKey);
|
||||
|
||||
Reference in New Issue
Block a user