forked from acmephp/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAcmeClientV2Interface.php
81 lines (75 loc) · 3.46 KB
/
AcmeClientV2Interface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
/*
* This file is part of the Acme PHP project.
*
* (c) Titouan Galopin <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace AcmePhp\Core;
use AcmePhp\Core\Exception\AcmeCoreClientException;
use AcmePhp\Core\Exception\AcmeCoreServerException;
use AcmePhp\Core\Exception\Protocol\CertificateRequestFailedException;
use AcmePhp\Core\Exception\Protocol\CertificateRequestTimedOutException;
use AcmePhp\Core\Exception\Protocol\ChallengeNotSupportedException;
use AcmePhp\Core\Protocol\AuthorizationChallenge;
use AcmePhp\Core\Protocol\CertificateOrder;
use AcmePhp\Ssl\CertificateRequest;
use AcmePhp\Ssl\CertificateResponse;
/**
* ACME protocol client interface.
*
* @author Titouan Galopin <[email protected]>
*/
interface AcmeClientV2Interface extends AcmeClientInterface
{
/**
* Request authorization challenge data for a list of domains.
*
* An AuthorizationChallenge is an association between a URI, a token and a payload.
* The Certificate Authority will create this challenge data and you will then have
* to expose the payload for the verification (see challengeAuthorization).
*
* @param string[] $domains the domains to challenge
*
* @throws AcmeCoreServerException when the ACME server returns an error HTTP status code
* (the exception will be more specific if detail is provided)
* @throws AcmeCoreClientException when an error occured during response parsing
* @throws ChallengeNotSupportedException when the HTTP challenge is not supported by the server
*
* @return CertificateOrder the Order returned by the Certificate Authority
*/
public function requestOrder(array $domains);
/**
* Request a certificate for the given domain.
*
* This method should be called only if a previous authorization challenge has
* been successful for the asked domain.
*
* WARNING : This method SHOULD NOT BE USED in a web action. It will
* wait for the Certificate Authority to validate the certificate and
* this operation could be long.
*
* @param CertificateOrder $order the Order returned by the Certificate Authority
* @param CertificateRequest $csr the Certificate Signing Request (informations for the certificate)
* @param int $timeout the timeout period
*
* @throws AcmeCoreServerException when the ACME server returns an error HTTP status code
* (the exception will be more specific if detail is provided)
* @throws AcmeCoreClientException when an error occured during response parsing
* @throws CertificateRequestFailedException when the certificate request failed
* @throws CertificateRequestTimedOutException when the certificate request timed out
*
* @return CertificateResponse the certificate data to save it somewhere you want
*/
public function finalizeOrder(CertificateOrder $order, CertificateRequest $csr, $timeout = 180);
/**
* Request the current status of an authorization challenge.
*
* @param AuthorizationChallenge $challenge The challenge to request
*
* @return AuthorizationChallenge A new instance of the challenge
*/
public function reloadAuthorization(AuthorizationChallenge $challenge);
}