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:----LhbOm4VxlNDdgv7z+TRzw8wrlADe6/zPxd8Vcel1NQhLYZ93e2eDUqGVZPOIH8cfakCUSB6q3mqkxjxhkshPQCbNznmdcWCP1I2MeRr6Jd3odQBd3FlWE6qqWnFryPv6u0Ua7zLS0aNH7wkKv+DIh1YFjcgAUerBJhf16ld43ZD6upnY+cevalzLNt0J7ilDLT7y+xEu1jCHXuH+NY7TcWLPKInfhp56FaiayDBduFi0zeEDmoHJpd/o/xU4OU+JncVmRFz5OGA8j6bTfLuIkN5C8zY/n1DPWccLd3HNcFwKaR+sJpEBJ9g/8hGfhfOUkHSOy8eiTyHexlls3NkbdPCfgh3mo5mL+R1L3yG6aPJNDdnuGzJERk8A1ciS9UmpWtdkRvU4KAtY9JMkpl1id/3sNiMO3RZW+p2dDQfLtDqVkvdfER4iF0GmQFICbRbMUp00xz3hcW2IBAGwHVbvCy9i0ITVDkOrOktsyiw8jS3jQswGQXtpCA8LtkW2wY9qm69rShzR2VbLXkJfFLC39MqG2rHWeXvIy4z5NxSvWRY9l7KQr5lbJY+f/UxTGM1MuyXWINBij+NYyF1Alblce1hoFZ2q5tlknLrbwRMcGEBPDWW3A5qZqobtfibNiMiKnyMdJAtTY7HveXgMxr9oMP+iJ5qVThvxhDzI60VZq5c=----ATTACHMENT:----NzU4Nzk2NTM5OTg2MTMxMyA5ODc0MDk1MDA5ODM0MjI1IDgzMDUxMDEyNzM3NTE3Nw==