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