CoreFiles by mySites.guru
PublicKeyCredential.php46 lines, 1,015 bytes, from Joomla_6.2.0-Stable-Full_Package.zip
Raw History Compare with 6.1.4
md5
9afb16d4bff5592bed33a61db567c7cc
sha1
5a3af9b31e68d2a98a4d80c011279e16ae01af6e
sha256
2d695abb07cc1d4a4a833396f088fd8abb4a63eefe8f17b34912139891de6453
<?php

declare(strict_types=1);

namespace Webauthn;

use const JSON_THROW_ON_ERROR;
use Stringable;

/**
 * @see https://www.w3.org/TR/webauthn/#iface-pkcredential
 */
class PublicKeyCredential extends Credential implements Stringable
{
    public function __construct(
        string $id,
        string $type,
        protected string $rawId,
        protected AuthenticatorResponse $response
    ) {
        parent::__construct($id, $type);
    }

    public function __toString(): string
    {
        return json_encode($this, JSON_THROW_ON_ERROR);
    }

    public function getRawId(): string
    {
        return $this->rawId;
    }

    public function getResponse(): AuthenticatorResponse
    {
        return $this->response;
    }

    /**
     * @param string[] $transport
     */
    public function getPublicKeyCredentialDescriptor(array $transport = []): PublicKeyCredentialDescriptor
    {
        return new PublicKeyCredentialDescriptor($this->getType(), $this->getRawId(), $transport);
    }
}

The same content is in 155 releases, Joomla 5.0.0-alpha1 to 6.2.1-rc1. See them all, or every version of this file.