<h3>JWS Verifiers</h3>
<p class="help">
    The following table lists all JWS Verifiers declared as services in your application configuration
    or using the Configuration Helper.<br>
    Verifiers directly created through the JWS Verifier Factory cannot be listed.
</p>
<table>
    <thead>
    <tr>
        <th>Service ID</th>
        <th>Algorithms</th>
    </tr>
    </thead>
    <tbody>
    {%  if collector.getData().jws.jws_builders is empty %}
    <tr>
        <td colspan="2"><i>No verifier</i></td>
    </tr>
    {% else %}
    {% for id, data in collector.getData().jws.jws_verifiers %}
        <tr>
            <td>{{ id }}</td>
            <td>
                <ul>
                    {% for algorithm in data.signature_algorithms %}
                        <li class="{% if algorithm in collector.getData().algorithm.messages|keys %}{{ collector.getData().algorithm.messages[algorithm]['severity'] }}{% else %}no-severity{% endif %}">
                            {{ algorithm }}
                        </li>
                    {% endfor %}
                </ul>
            </td>
        </tr>
    {% endfor %}
    {% endif %}
    </tbody>
</table>

<h4>Verified Tokens</h4>
<p class="help">
    The following tables list all tokens verified (or not) by the JWS Verifiers.<br>
    Failure reason is related to the key(s) used.
</p>
<table>
    <thead>
    <tr>
        <th scope="col">Status</th>
        <th scope="col">JWS</th>
        <th scope="col">Key set</th>
        <th scope="col" width="35%">Detached Payload (optional)</th>
        <th scope="col">Signature index / Exception</th>
        <th scope="col">Key used for verification</th>
    </tr>
    </thead>
    <tbody>
    {% for event in collector.getData().jws.events.verification_success %}
        <tr class="status-success">
            <td>Success</td>
            <td>{{ profiler_dump(event.seek("jws")) }}</td>
            <td>{{ profiler_dump(event.seek("JWKSet")) }}</td>
            <td>{% if not event.detachedPayload is null %}{{ profiler_dump(event.seek("detachedPayload")) }}{% else %}<i>none</i>{% endif %}</td>
            <td>{{ event.signature }}</td>
            <td>{{ profiler_dump(event.seek("JWK")) }}</td>
        </tr>
    {% endfor %}
    {% for event in collector.getData().jws.events.verification_failure %}
        <tr class="status-error">
            <td>Failure</td>
            <td>{{ profiler_dump(event.seek("jws")) }}</td>
            <td>{{ profiler_dump(event.seek("JWKSet")) }}</td>
            <td>{% if not event.detachedPayload is null %}{{ profiler_dump(event.seek("detachedPayload")) }}{% else %}<i>none</i>{% endif %}</td>
            <td><i>---</i></td>
            <td><i>---</i></td>
        </tr>
    {% endfor %}
    </tbody>
</table>
