public static function validatePublicKey($value)
    {
        $value = preg_replace('/\s+/', ' ', $value);
        if (!strpos($value, ' ')) {
            return false;
        }
        list($type, $key) = explode(' ', $value, 3);
        if (!in_array($type, static::$allowedAlgorithms) || base64_decode($key, true) === false) {
            return false;
        }

        return true;
    }