authData = $authData; $this->rpIdHash = $rpIdHash; $this->flags = $flags; $this->signCount = $signCount; $this->attestedCredentialData = $attestedCredentialData; } public static function hydrate( array $data ): self { Assert::that( $data, 'AuthenticatorData hydration does not contain "%s".' ) ->keyExists( 'authData' ) ->keyExists( 'rpIdHash' ) ->keyExists( 'flags' ) ->keyExists( 'signCount' ); return new self( $data['authData'], $data['rpIdHash'], $data['flags'], $data['signCount'], isset( $data['attestedCredentialData'] ) ? AttestedCredentialData::hydrate( $data['attestedCredentialData'] ) : null ); } public function get_auth_data(): string { return $this->authData; } public function get_rp_id_hash(): BinaryString { return $this->rpIdHash; } public function is_user_present(): bool { return 0 !== ( ord( $this->flags ) & self::FLAG_UP ); } public function is_user_verified(): bool { return 0 !== ( ord( $this->flags ) & self::FLAG_UV ); } public function has_attested_credential_data(): bool { return 0 !== ( ord( $this->flags ) & self::FLAG_AT ); } public function is_eligible_for_backups(): bool { return 0 !== ( ord( $this->flags ) & self::FLAG_BE ); } public function is_backed_up(): bool { return 0 !== ( ord( $this->flags ) & self::FLAG_BS ); } public function get_sign_count(): int { return $this->signCount; } public function get_attested_credential_data(): ?AttestedCredentialData { return $this->attestedCredentialData; } public function jsonSerialize(): array { $data = get_object_vars( $this ); unset( $data['authData'] ); return array_filter( \ITSEC_Lib::recursively_json_serialize( $data ), function ( $value ) { return ! is_null( $value ); } ); } }