PHP Class Kelunik\Acme\AcmeService

Author: Niklas Keller ([email protected])
Afficher le fichier Open project: kelunik/acme Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
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.

Method Details

__construct() public méthode

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

answerChallenge() public méthode

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
Résultat Amp\Promise resolves to the decoded JSON response

pollForCertificate() public méthode

Polls for a certificate.
public pollForCertificate ( string $location ) : Amp\Promise
$location string URI of the certificate
Résultat Amp\Promise resolves to the complete certificate chain as array of PEM encoded certificates

pollForChallenge() public méthode

Polls until a challenge has been validated.
public pollForChallenge ( string $location ) : Amp\Promise
$location string URI of the challenge
Résultat Amp\Promise resolves to null

register() public méthode

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
Résultat Amp\Promise resolves to a Registration object

requestCertificate() public méthode

Requests a new certificate.
public requestCertificate ( string $csr ) : Amp\Promise
$csr string certificate signing request
Résultat Amp\Promise resolves to the URI where the certificate will be provided

requestChallenges() public méthode

Requests challenges for a given DNS name.
public requestChallenges ( string $dns ) : Amp\Promise
$dns string DNS name to request challenge for
Résultat Amp\Promise resolves to an array of challenges

revokeCertificate() public méthode

Revokes a certificate.
public revokeCertificate ( string $pem ) : Amp\Promise
$pem string PEM encoded certificate
Résultat Amp\Promise resolves to true