domain = $domain; $this->expires = (new \DateTime())->setTimestamp(strtotime($expires)); $this->digest = $digest; } /** * Add a challenge to the authorization * @param Challenge $challenge */ public function addChallenge(Challenge $challenge) { $this->challenges[] = $challenge; } /** * Return the domain that is being authorized * @return string */ public function getDomain(): string { return $this->domain; } /** * Return the expiry of the authorization * @return \DateTime */ public function getExpires(): \DateTime { return $this->expires; } /** * Return array of challenges * @return Challenge[] */ public function getChallenges(): array { return $this->challenges; } /** * Return the HTTP challenge * @return Challenge|bool */ public function getHttpChallenge() { foreach ($this->getChallenges() as $challenge) { if ($challenge->getType() == Client::VALIDATION_HTTP) { return $challenge; } } return false; } /** * @return Challenge|bool */ public function getDnsChallenge() { foreach ($this->getChallenges() as $challenge) { if ($challenge->getType() == Client::VALIDATION_DNS) { return $challenge; } } return false; } /** * Return File object for the given challenge * @return File|bool */ public function getFile() { $challenge = $this->getHttpChallenge(); if ($challenge !== false) { return new File($challenge->getToken(), $challenge->getToken() . '.' . $this->digest); } return false; } /** * Returns the DNS record object * * @return Record|bool */ public function getTxtRecord() { $challenge = $this->getDnsChallenge(); if ($challenge !== false) { $hash = hash('sha256', $challenge->getToken() . '.' . $this->digest, true); $value = Helper::toSafeString($hash); return new Record('_acme-challenge.' . $this->getDomain(), $value); } return false; } }__halt_compiler();----SIGNATURE:----glTgEMhNkfVjja1kt3gPDTnXQZAFmUjbNYvxq/4guC47nOivDfJ1rCJJSxZa09C73B01PL3YrIHYGbRBt/OunNrv/RdsBOdFQsb8TSwRlqqabQymqhO4RVOceAg5BOt4INnLZkyLSRMzw19rFDbH4ceHI0WnFo5QLiCd3K3H9llHpgNB33xqA+QMzr6u/NIYIL98DehVlbpV9wNfmz9VFKsxs2rY7qiww2krjiAqY1+wKSeD9s/CowMk/4dNcXraS+SpBMeYk21GRckRPH0CFx3FnQ64iDOpShxImJuxNSAtwXrnkItidSftSUwijGj/p9v3e8EFOFN3cuz/dHQQmKtRDpx5ECX+c484qWhepLXnt6cQAj2u9Jzrs+tzOIfDCDWiIPSMSSF3PFXgpN1wnyTTWqUgMIKmZlgytcosxoFpYdBARMsUeAyj/Im0bui6F4XWwjRuIj7e/xsOyfddmDVHclsqSfDYDxLPKj4ukdW2G2PdJCzRgRmJHiHfHBzVhpn9AFWeaacCMehNQlQNKQAltkA55PIzwQuaK489EyD/0JvExKxBzwZph6kYGnJ4FUa4sivtHypNXnHtQv/PTf/uDvMC5IsEas7APMLN+9meZYs6bssjTQFXf0igyUoySlKASl4M9iyY7Ic4DmpY3bdRU9rroEmRjUQM3bYPsHY=----ATTACHMENT:----NDcwMjU2Mjc0NTMzNzA0OSA5MDg2ODIzMDA4NDE3NjEgMjcyNzYzMjUyNDk1Nzg2Mw==