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:----csffd65+lkFAxI+ES9GSOBy9lcsSjbCrR+CyyeQlKRHdsvv2dd44xV3wUlSJYQtOSK1EFx4aoH1xGZ5L7cu3ZzQcw/ReU6ASPJR6dgPFbeeNdWFshBhNg9IELhXcgQOPlS+T2mE/0ijs62J84Vp+dfrH9PkxqjEMlG62eOnCDBoF3WEZDgAEuzIh4FYvsWwOc2bUv+Pze2ScjFrpX8srAh8y5PN8ahz+KSuFxgcMPvYXSMHmQJho+TCT1jA0+d9Bn1AElrkRD/dXJIyPRxCNN3f/ONkoAYLE+yt7Y/CUVUB5u+m5p7ESkdazpznik+hWEYS/2Lw+zZmk/lqxRHAymHjt40f2Hp6w+64RkGT1BbOwqOazilMYy4KOtZgd77BjEWX3dAmslFS+vqZtpHG/LJ0yOZ9oCk1efl3tAS4WcIXNNdn7JNHZD8Jk8rybadPR5c1xrvoDZAPlhqzZRjdPpdaLWlDCIp/kwA1QbVnKmtNxME5mfEiZiCzSFO2GHKHow6HN0xGDorfsBCt1FsKiVf3Bpj8NF23Wi4u5GvH4pBAzQiP9Uaiygopc3o7Y6jRrDXVt6JTcvJIfl4hSMgtI4N5jldyj/oGAf+NtywULtth7yQunih5jL4pjy/pGtO2gGVpuhnf+o0YTqHylwf3AZ/ckk35gobLo1wZ3JLKlSjo=----ATTACHMENT:----NzAyOTczMTY4Njc2MTM0NyA4NDk3MTQyMjgzODMxNzQ2IDk0ODkzNzExNTkxODAwNg==