<div class="tab">
    <h3 class="tab-title">JWE Services</h3>
    <div class="tab-content">
        <h4>JWE Builders</h4>
        <table>
            <thead>
            <tr>
                <th>Service ID</th>
                <th>Key Encryption Algorithms</th>
                <th>Content Encryption Algorithms</th>
                <th>Compression Methods</th>
            </tr>
            </thead>
            <tbody>
            {% for id, data in collector.getData().jwe.jwe_builders %}
                <tr>
                    <td>{{ id }}</td>
                    <td>
                        <ul>
                            {% for algorithm in data.key_encryption_algorithms %}
                                <li>
                                    <span{% if algorithm in collector.getData().algorithm.messages|keys %}
                                     class="{{ collector.getData().algorithm.messages[algorithm]['severity'] }}"
                                        {% else %}
                                        {% endif %}>
                                        {{ algorithm }}
                                    </span>
                                </li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for algorithm in data.content_encryption_algorithms %}
                                <li>
                                    <span{% if algorithm in collector.getData().algorithm.messages|keys %}
                                        class="{{ collector.getData().algorithm.messages[algorithm]['severity'] }}"
                                            {% else %}
                                            {% endif %}>
                                        {{ algorithm }}
                                    </span>
                                </li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for method in data.compression_methods %}
                                <li>{{ method }}</li>
                            {% endfor %}
                        </ul>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <h4>JWE Decrypters</h4>
        <table>
            <thead>
            <tr>
                <th>Service ID</th>
                <th>Key Encryption Algorithms</th>
                <th>Content Encryption Algorithms</th>
                <th>Compression Methods</th>
            </tr>
            </thead>
            <tbody>
            {% for id, data in collector.getData().jwe.jwe_decrypters %}
                <tr>
                    <td>{{ id }}</td>
                    <td>
                        <ul>
                            {% for algorithm in data.key_encryption_algorithms %}
                                <li>
                                        <span{% if algorithm == 'RSA1_5' %} class="severity-high"{% elseif 'ECDH-ES' in algorithm %} class="severity-medium"{% endif %}>
                                            {{ algorithm }}
                                        </span>
                                </li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for algorithm in data.content_encryption_algorithms %}
                                <li>{{ algorithm }}</li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for method in data.compression_methods %}
                                <li>{{ method }}</li>
                            {% endfor %}
                        </ul>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <h4>JWE Loaders</h4>
        <table>
            <thead>
            <tr>
                <th>Service ID</th>
                <th>Serializers</th>
                <th>Key Encryption Algorithms</th>
                <th>Content Encryption Algorithms</th>
                <th>Compression Methods</th>
                <th>Header Checkers</th>
            </tr>
            </thead>
            <tbody>
            {% for id, data in collector.getData().jwe.jwe_loaders %}
                <tr>
                    <td>{{ id }}</td>
                    <td>
                        <ul>
                            {% for serializer in data.serializers %}
                                <li>{{ serializer }}</li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for algorithm in data.key_encryption_algorithms %}
                                <li>
                                    <span{% if algorithm == 'RSA1_5' %} class="severity-high"{% elseif 'ECDH-ES' in algorithm %} class="severity-medium"{% endif %}>
                                        {{ algorithm }}
                                    </span>
                                </li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for algorithm in data.content_encryption_algorithms %}
                                <li>{{ algorithm }}</li>
                            {% endfor %}
                        </ul>
                    </td>
                    <td>
                        <ul>
                            {% for method in data.compression_methods %}
                                <li>{{ method }}</li>
                            {% endfor %}
                        </ul>
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        {% set encryptionAlgorithms = collector.getData().algorithm.algorithms %}
        {% if encryptionAlgorithms['Key Encryption'] is defined %}
            <h4>Available Key Encryption Algorithms</h4>
            <table>
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Alias</th>
                    <th>Message</th>
                </tr>
                </thead>
                <tbody>
                {% for alias, alg in encryptionAlgorithms['Key Encryption'] %}
                    <tr>
                        <td {% if alg.name in collector.getData().algorithm.messages|keys %}
                            class="{{ collector.getData().algorithm.messages[alg.name]['severity'] }}"
                                {% endif %}>{{ alg.name }}</td>
                        <td {% if alg.name in collector.getData().algorithm.messages|keys %}
                            class="{{ collector.getData().algorithm.messages[alg.name]['severity'] }}"
                                {% endif %}>{{ alias }}</td>
                        <td {% if alg.name in collector.getData().algorithm.messages|keys %}
                            class="{{ collector.getData().algorithm.messages[alg.name]['severity'] }}"
                                {% endif %}>
                            {% if alg.name in collector.getData().algorithm.messages|keys %}
                                {{ collector.getData().algorithm.messages[alg.name]['message']|raw }}
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            <h4>Available Content Encryption Algorithms</h4>
            <table>
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Alias</th>
                    <th>Message</th>
                </tr>
                </thead>
                <tbody>
                {% for alias, alg in encryptionAlgorithms['Content Encryption'] %}
                    <tr>
                        <td {% if alg.name in collector.getData().algorithm.messages|keys %}
                            class="{{ collector.getData().algorithm.messages[alg.name]['severity'] }}"
                                {% endif %}>{{ alg.name }}</td>
                        <td {% if alg.name in collector.getData().algorithm.messages|keys %}
                            class="{{ collector.getData().algorithm.messages[alg.name]['severity'] }}"
                                {% endif %}>{{ alias }}</td>
                        <td {% if alg.name in collector.getData().algorithm.messages|keys %}
                            class="{{ collector.getData().algorithm.messages[alg.name]['severity'] }}"
                                {% endif %}>
                            {% if alg.name in collector.getData().algorithm.messages|keys %}
                                {{ collector.getData().algorithm.messages[alg.name]['message']|raw }}
                            {% endif %}
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            <h4>Compression Methods</h4>
            <table>
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Alias</th>
                </tr>
                </thead>
                <tbody>
                {% for alias, name in collector.getData().jwe.compression_methods %}
                    <tr>
                        <td>{{ name }}</td>
                        <td>{{ alias }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            <h4>JWE Serialization Modes</h4>
            <table>
                <thead>
                <tr>
                    <th>Name</th>
                    <th>Alias</th>
                </tr>
                </thead>
                <tbody>
                {% for alias, name in collector.getData().jwe.jwe_serialization %}
                    <tr>
                        <td>{{ name }}</td>
                        <td>{{ alias }}</td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        {% else %}
            The is no encryption algorithm. Did you installed "web-token/jwt-encryption-bundle"?
        {% endif %}
    </div>
</div>
