aaid = $aaid; $this->aaguid = $aaguid; $this->attestationCertificateKeyIdentifiers = $attestationCertificateKeyIdentifiers; $this->hash = Base64Url::decode($hash); $this->url = $url; $this->timeOfLastStatusChange = $timeOfLastStatusChange; $this->rogueListURL = $rogueListURL; $this->rogueListHash = $rogueListHash; } public function getAaid(): ?string { return $this->aaid; } public function getAaguid(): ?string { return $this->aaguid; } public function getAttestationCertificateKeyIdentifiers(): array { return $this->attestationCertificateKeyIdentifiers; } public function getHash(): ?string { return $this->hash; } public function getUrl(): ?string { return $this->url; } public function addStatusReports(StatusReport $statusReport): self { $this->statusReports[] = $statusReport; return $this; } /** * @return StatusReport[] */ public function getStatusReports(): array { return $this->statusReports; } public function getTimeOfLastStatusChange(): string { return $this->timeOfLastStatusChange; } public function getRogueListURL(): string { return $this->rogueListURL; } public function getRogueListHash(): string { return $this->rogueListHash; } public static function createFromArray(array $data): self { $data = Utils::filterNullValues($data); Assertion::keyExists($data, 'timeOfLastStatusChange', Utils::logicException('Invalid data. The parameter "timeOfLastStatusChange" is missing')); Assertion::keyExists($data, 'statusReports', Utils::logicException('Invalid data. The parameter "statusReports" is missing')); Assertion::isArray($data['statusReports'], Utils::logicException('Invalid data. The parameter "statusReports" shall be an array of StatusReport objects')); $object = new self( $data['aaid'] ?? null, $data['aaguid'] ?? null, $data['attestationCertificateKeyIdentifiers'] ?? [], $data['hash'] ?? null, $data['url'] ?? null, $data['timeOfLastStatusChange'], $data['rogueListURL'] ?? null, $data['rogueListHash'] ?? null ); foreach ($data['statusReports'] as $statusReport) { $object->addStatusReports(StatusReport::createFromArray($statusReport)); } return $object; } public function jsonSerialize(): array { $data = [ 'aaid' => $this->aaid, 'aaguid' => $this->aaguid, 'attestationCertificateKeyIdentifiers' => $this->attestationCertificateKeyIdentifiers, 'hash' => Base64Url::encode($this->hash), 'url' => $this->url, 'statusReports' => array_map(static function (StatusReport $object): array { return $object->jsonSerialize(); }, $this->statusReports), 'timeOfLastStatusChange' => $this->timeOfLastStatusChange, 'rogueListURL' => $this->rogueListURL, 'rogueListHash' => $this->rogueListHash, ]; return Utils::filterNullValues($data); } }