<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php

namespace Intervention\HttpAuth\Token;

use Intervention\HttpAuth\Key;

class HttpAuthentification extends NullToken
{
    /**
     * Parsed authentification value
     *
     * @var string
     */
    protected $value;

    /**
     * Transform current instance to key object
     *
     * @return Key
     */
    public function toKey(): Key
    {
        list($username, $password) = explode(':', base64_decode(substr($this->value, 6)));

        $key = new Key();
        $key->setProperty('username', $username);
        $key->setProperty('password', $password);

        return $key;
    }

    /**
     * Parse e