PHP Класс Kelunik\Acme\AcmeService

Автор: Niklas Keller ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( AcmeClient $acmeClient ) AcmeService constructor.
answerChallenge ( string $location, string $keyAuth ) : Amp\Promise Answers a challenge and signals that the CA should validate it.
pollForCertificate ( string $location ) : Amp\Promise Polls for a certificate.
pollForChallenge ( string $location ) : Amp\Promise Polls until a challenge has been validated.
register ( string $email, string | null $agreement = null ) : Amp\Promise Registers a new account on the server.
requestCertificate ( string $csr ) : Amp\Promise Requests a new certificate.
requestChallenges ( string $dns ) : Amp\Promise Requests challenges for a given DNS name.
revokeCertificate ( string $pem ) : Amp\Promise Revokes a certificate.

Приватные методы

Метод Описание
doAnswerChallenge ( string $location, string $keyAuth ) : Generator Answers a challenge and signals that the CA should validate it.
doPollForCertificate ( string $location ) : Generator Polls for a certificate.
doPollForChallenge ( string $location ) : Generator Polls until a challenge has been validated.
doRegister ( string $email, string | null $agreement = null ) : Generator Registers a new account on the server.
doRequestCertificate ( string $csr ) : Generator Requests a new certificate.
doRequestChallenges ( string $dns ) : Generator Requests challenges for a given DNS name.
doRevokeCertificate ( string $pem ) : Generator Revokes a certificate.
generateException ( Amp\Artax\Response $response ) : AcmeException Generates a new exception using the response to provide details.
parseRetryAfter ( string $header ) : integer Parses a retry header into seconds to wait until a request should be retried.

Описание методов

__construct() публичный Метод

AcmeService constructor.
public __construct ( AcmeClient $acmeClient )
$acmeClient AcmeClient ACME client

answerChallenge() публичный Метод

Answers a challenge and signals that the CA should validate it.
public answerChallenge ( string $location, string $keyAuth ) : Amp\Promise
$location string URI of the challenge
$keyAuth string key authorization
Результат Amp\Promise resolves to the decoded JSON response

pollForCertificate() публичный Метод

Polls for a certificate.
public pollForCertificate ( string $location ) : Amp\Promise
$location string URI of the certificate
Результат Amp\Promise resolves to the complete certificate chain as array of PEM encoded certificates

pollForChallenge() публичный Метод

Polls until a challenge has been validated.
public pollForChallenge ( string $location ) : Amp\Promise
$location string URI of the challenge
Результат Amp\Promise resolves to null

register() публичный Метод

Registers a new account on the server.
public register ( string $email, string | null $agreement = null ) : Amp\Promise
$email string e-mail address for contact
$agreement string | null agreement URI or null if not agreed yet
Результат Amp\Promise resolves to a Registration object

requestCertificate() публичный Метод

Requests a new certificate.
public requestCertificate ( string $csr ) : Amp\Promise
$csr string certificate signing request
Результат Amp\Promise resolves to the URI where the certificate will be provided

requestChallenges() публичный Метод

Requests challenges for a given DNS name.
public requestChallenges ( string $dns ) : Amp\Promise
$dns string DNS name to request challenge for
Результат Amp\Promise resolves to an array of challenges

revokeCertificate() публичный Метод

Revokes a certificate.
public revokeCertificate ( string $pem ) : Amp\Promise
$pem string PEM encoded certificate
Результат Amp\Promise resolves to true