name; } /** * @param string $name * @return WebauthnKey */ public function setName(string $name): WebauthnKey { $this->name = $name; return $this; } /** * @return User|null */ public function getUser(): ?User { return $this->user; } /** * @param User|null $user * @return WebauthnKey */ public function setUser(?User $user): WebauthnKey { $this->user = $user; return $this; } /** * @return int */ public function getId(): int { return $this->id; } public static function fromRegistration(BasePublicKeyCredentialSource $registration): self { return new self( $registration->getPublicKeyCredentialId(), $registration->getType(), $registration->getTransports(), $registration->getAttestationType(), $registration->getTrustPath(), $registration->getAaguid(), $registration->getCredentialPublicKey(), $registration->getUserHandle(), $registration->getCounter(), $registration->getOtherUI() ); } }