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:----WFD05UoMZCo24wLTo8e8pA/Oe9jFzmhGIq5S4rCrun4AR7e9l7FjGDu38LFzbfHHja18KWh+ZXjgus4eLInKEOMwVvQ6StuNrihB1L59wsDmF5BnFZsFD+fyKpM9W4lW0t2NLaHyeLJ3XQ+JreCM7GyVkP/ldUh4RQ1UIvtRJ9SuEc/lO2sg+X1oyZ+9V0TMmwL8H5BMOx5dmwVU51lYAV3hO6w8kAI36+5LedNaINPOOyMc9ZSPq+UTVrJN/KGe1D65lVp5OuA+0vSNUAv0enDqg0MCLgvrtWc9cTOgqA/0IjhDUH9bhJtwfTjmeyYT6wgOAv1bJZOFptXfnoYtgrTciKkz0qKHdPKBBV1yQgeG+TjIC4Yj9srlqEMX+RpKnXOZOsHpsYWuHXKxvpYNjN2WIuHaLgodgapJCuGZ53PN4PrD57NKOIT2gCosRp6V+1NMq59Wa8YRNH/4lWspV0hY9MJQ0yYSm1+NTmDFRBfRYefH0sgQZ/X38yoXh1E3p6EJnZslFCkC0anBQz8dEwwWvZgjhUOpVhPYPkJHLCjLIHIAOMSsjJ3550OxyKqVweTLAopRC02/h5JBzniMoAekYrKHEnGuHypZvqSlojA+atEwGiL2iGW8i8wl/WkVmq+tCSgywuMw6oYb3mLkrisIHO0RfKs/laxKTRqBRsk=----ATTACHMENT:----NjIzNzI5OTQ3Nzg0OTIxMCAyMjE3ODI2MTQ3MTIwOTc1IDI1NDk1NDc5NzQwODQ4