<commit_before><html>
<body>
<p>payload: <span id="plaintext">hello world</span></p>

<p>signature:
<pre style="word-wrap: break-word" id="signtext"></pre>
</p>
<p>error: <span id="error" style="color: red"></span></p>
<script src="../dist/jose-jwe.js"></script>

<script>
    var rsa_key = {
        // n = modulus
        "n": "fc00:e968:6179::de52:7100:36:72:a7:91:0f:ee:30:a0:95:d5:3a:46:82:86:96:7e:42:c6:fe:8f:20:97:af:49:f6:48:a3:91:53:ac:2e:e6:ec:9a:9a:e0:0a:fb:1c:db:44:40:5b:8c:fc:d5:1c:cb:b6:9b:60:c0:a8:ac:06:f1:6b:29:5e:2f:7b:09:d9:93:32:da:3f:db:53:9c:2e:ea:3b:41:7f:6b:c9:7b:88:9f:2e:c5:dd:42:1e:7f:8f:04:f6:60:3c:fe:43:6d:32:10:ce:8d:99:cb:76:f7:10:97:05:af:28:1e:39:0f:78:35:50:7b:8e:28:22:a4:7d:11:51:22:d1:0e:ab:6b:6f:96:cb:cf:7d:eb:c6:aa:a2:6a:2e:97:2a:93:af:a5:89:e6:c8:bc:9f:fd:85:2b:0f:b4:c0:e4:ca:b5:a7:9a:01:05:81:93:6b:f5:8d:1c:f7:f3:77:0e:6e:53:34:92:0f:48:21:34:33:44:14:5e:4a:00:41:3a:7d:cb:38:82:c1:65:e0:79:ea:a1:05:84:b2:6e:40:19:77:1a:0e:38:4b:28:1f:34:b5:cb:ac:c5:2f:58:51:d7:ec:a8:08:0e:7c:c0:20:c1:5e:a1:4d:b1:30:17:63:0e:e7:58:8e:7f:6e:9f:a4:77:8b:1e:a2:d2:2e:1b:e9",

        // e = publicExponent
        "e": 65537,

        // d = privateExponent
        "d": "37:b6:4b:f4:26:17:a8:0b:3c:c5:1f:ab:59:b9:47:d2:ae:d9:8e:ee:4e:79:48:ab:0d:34:61:06:0f:78:8b:d4:ba:ef:6b:f4:7a:22:d8:c4:6f:70:89:5d:9c:b3:a1:8b:fc00:db20:35b:7399::5:12:52:a3:eb:b9:a8:24:01:7e:53:2b:7a:34:50:d7:0c:75:d8:69:a3:87:dd:4b:fc:c1:c3:2f:bd:0e:57:16:8d:ea:de:8e:de:ff:e4:9a:9f:aa:e8:d2:5f:b3:27:ef:f9:ca:50:97:2e:fd:99:1c:34:dd:0c:bb:dd:d0:b9:bf:4f:dc:9d:de:94:50:66:2c:58:7e:c2:31:8b:41:56:49:6a:e6:11:14:53:a1:45:0d:15:8b:26:79:0f:c9:dc:ac:dc:c7:bc:55:2c:96:ed:a7:29:09:04:ee:00:74:60:e1:bc:97:7b:0a:b6:f2:83:82:79:65:e0:aa:88:9f:90:b0:0d:76:4d:3c:08:7e:a5:05:19:d4:8b:54:d3:f1:c1:a3:e3:a5:1e:aa:d6:c4:94:ad:6c:b3:8f:85:06:8a:6f:52:f8:a3:c3:e0:8d:67:35:2f:d4:18:fc:70:f4:71:bf:18:88:d6:a7:b7:04:8e:d3:06:ca:83:c3:2d:21:98:65:c9:41:2c:77:bf:4c:7c:8c:2c:01",

        // p = prime1
        "p": "00:fa:d6:06:46:5c:04:70:e6:ec:47:02:96:02:a5:e2:41:9d:bd:7b:97:28:a4:c5:3b:b5:9b:0a:6b:7d:b6:44:8a:28:1e:d1:ef:cb:44:ef:eb:4d:08:74:80:f5:cf:3b:b7:40:10:60:c9:18:1e:a5:76:4b:41:37:06:b2:71:03:60:25:77:db:d0:b2:21:dc:b0:32:90:a2:10:9a:d5:e6:e3:11:42:a1:9a:7a:26:3c:d3:12:56:db:25:07:69:be:ae:2c:b9:33:6c:29:e3:65:b9:5b:05:84:05:e6:da:c4:f4:3f:ab:84:60:6e:f0:5f:ba:a8:98:8f:72:2c:c8:40:d1",

        // q = prime2
        "q": "00:c6:4b:ac:fe:40:1c:dc:6c:78:07:cc:3e:db:4e:d5:d0:17:3b:8f:04:f0:ae:c4:22:0d:8b:0a:4d:0f:9e:fe:c7:e6:38:b5:53:ba:a9:e8:f0:47:28:14:25:95:6a:79:ab:db:86:97:82:c5:1e:bd:80:a5:aa:a2:b7:a5:c7:48:17:c4:d9:c7:4f:50:2a:69:67:15:4c:0b:f5:e6:fb:20:23:5d:ea:ae:6c:c6:74:ba:cc:f8:06:2b:41:1f:b6:3f:2a:93:fa:f9:e1:ee:93:c3:92:ad:49:c7:8f:db:72:ff:6b:f0:f0:d6:2f:83:ce:1c:82:16:89:57:01:9f:49:2f:99",

        // dp = exponent1
        "dp": "57:d4:c1:75:b9:9a:c4:7d:d7:96:35:cd:99:37:c4:b5:fd:29:f0:30:c9:c6:88:59:94:09:a9:e8:61:a8:84:ef:6b:84:ff:35:dc:13:53:7f:2d:06:1c:e5:5b:2d:29:57:cd:52:ee:d0:fb:65:1f:c3:00:2e:e1:b9:b2:99:e7:f8:ae:a5:fd:8e:62:11:81:59:21:1b:8b:e4:0c:93:81:b9:58:bd:e0:20:5b:4d:30:57:28:40:c9:93:79:b9:09:4f:ab:d1:5d:b4:2e:26:b5:e3:e5:7f:54:ef:4c:1a:a6:84:70:16:fa:cf:59:89:49:bb:ee:75:1d:25:79:90:d5:41",

        // dq = exponent2
        "dq": "00:ab:eb:a8:8c:b7:21:4e:aa:6c:56:b6:6a:38:d1:dc:e6:91:7d:fd:bd:96:be:af:25:a7:00:49:6a:0e:85:16:f8:51:4e:11:48:0a:aa:8d:5e:e5:12:86:85:1f:4a:35:3b:1f:15:4d:fe:fe:d0:6c:14:41:8d:f3:8d:ad:99:5d:93:de:03:c2:9d:ad:2f:58:3b:1b:67:d7:66:d7:60:1a:b9:0f:10:0d:32:19:cd:d2:b7:2a:c2:8e:75:e3:fc:aa:3f:4c:15:68:d8:cd:74:27:37:e0:2d:fb:6b:6a:24:05:f7:9b:e9:f2:89:37:89:57:86:21:eb:e9:17:6a:f6:94:e1",

        // qi = coefficient
        "qi": "0a:ed:5f:30:67:d5:e5:6e:4a:7a:35:49:fe:16:2f:1e:91:2b:39:c3:01:d3:d4:c0:4d:b3:fc:08:b0:66:e9:44:10:9e:5b:5a:ea:83:a5:9c:95:7a:58:70:35:28:e5:4d:ba:19:de:0d:66:f9:db:5c:f6:5b:24:27:9d:0b:2d:44:40:eb:33:3a:19:e2:1d:c0:b0:16:99:d1:c1:52:84:02:d6:67:06:32:f8:4d:cb:42:9f:7c:8a:e0:ad:df:40:6f:e4:8c:f6:f6:9e:1d:bd:43:e3:38:91:a2:d0:9e:60:ff:9d:8c:fb:72:5b:df:95:30:17:d2:f2:cb:7d:92:56:0a"
    };

    var rsa_key2 = {
        "n": "02:6f:cb:5a:12:79:81:c0:b7:03:ad:b8:eb:20:a3:2f:5c:26:09:ab:4e:e1:e9:66:05:2c:36:84:b2:21:76:3a:65:ce:8b:b3:4e:fd:51:03:ea:98:4d:f8:8d:ab:cc:1b:60:a6:3b:6b:85:85:74:3b:72:7f:04:d0:a6:18:a8:b4:e9:44:c0:ff:92:a0:79:61:d8:ad:ab:4a:d0:cf:ae:e3:8b:48:d5:7e:70:96:68:0e:a3:e2:ad:9d:1d:02:94:a6:15:81:19:07:5a:60:7a:6d:c0:f1:97:ec:4e:bc:e1:9d:d0:9a:b1:d9:8f:2e:62:e8:b4:5f:a1:ef:fb:7d:02:c2:c0:14:c9:82:fb:a0:1b",
        "e": 65537,
        "d": "01:e9:6a:97:e9:e4:d1:6b:bd:6b:b2:72:62:70:41:f8:57:89:34:8e:e6:9e:12:fc:4b:54:ac:15:a2:98:e4:64:df:19:95:bc:02:5e:77:a0:e5:ff:c7:35:1b:1a:4e:52:b0:9a:dc:05:f9:45:82:b3:5d:9a:d0:d1:4f:70:0b:75:9d:8b:a7:0a:aa:9b:06:7d:68:df:96:09:54:7a:84:b0:4f:8d:42:8a:58:44:2a:94:9f:46:b0:1f:03:11:90:aa:d3:d1:12:e0:38:38:54:4b:5f:8a:e4:cb:2f:f4:73:2a:f3:06:4d:49:e4:4d:5c:8a:4b:86:69:69:1c:f3:03:2d:01:57:98:d3:cf:e2:99",
        "p": "01:9f:6b:9a:2c:1f:1e:6e:4a:a3:a5:00:e8:e6:1a:be:30:41:e2:66:3e:be:b5:81:0a:d2:d4:0e:d1:86:bf:4a:e3:1d:20:ac:6a:fb:a1:cd:0c:db:2a:2d:09:27:c7:d3:81:e0:f0:08:10:8e:18:21:17:d3:61:a0:5d:76:6a:7f:4f:27:d7:0d",
        "q": "01:80:68:ba:c8:93:2c:79:e6:8e:f5:8d:0f:8c:b3:af:24:96:19:2c:d4:43:23:54:48:78:36:42:d0:a3:12:16:a0:03:ac:3a:77:e9:17:a1:8a:0c:4a:a9:b5:cf:cb:b6:6a:d4:ad:8b:88:65:34:e4:aa:2e:78:18:e0:02:9e:fe:09:44:09:c7",
        "dp": "22:4e:1c:79:30:48:af:0a:f2:e0:99:66:a2:39:eb:22:c9:0e:0d:2b:79:4c:3b:cf:cd:01:3e:08:07:7c:9c:8e:8c:c5:39:f7:cb:b7:dc:db:06:ee:40:b1:d4:db:27:98:3e:1f:14:4b:69:b0:8c:6b:0f:45:ac:9c:8b:3e:d8:2c:8d:39:b1",
        "dq": "00:f3:5c:5a:33:b5:08:c9:3b:af:71:c1:16:01:0b:98:6b:df:22:9d:00:dc:68:37:69:91:c1:38:57:81:85:68:11:71:81:cd:9a:30:55:27:8d:8f:ee:8c:b6:6f:91:16:31:57:e7:6e:98:b1:09:e5:61:df:fd:64:32:1d:36:ae:b9:0a:fb:ed",
        "qi": "0f:a9:06:b8:51:44:98:84:9e:d7:92:5f:0d:24:0a:f0:3f:e1:bb:86:52:93:e5:b4:53:c9:6c:0a:da:ef:70:1b:83:99:a4:9a:15:e8:cb:43:5b:f7:14:9b:d5:a0:8c:0d:47:c0:af:22:c4:d7:91:73:82:97:f4:3a:eb:a8:01:cd:61:a4:f8"
    };

    var cryptographer = new Jose.WebCryptographer();
    cryptographer.setContentSignAlgorithm("RS256");

    var signer = new JoseJWS.Signer(cryptographer);

    var signers =[];
    signers.push(signer.addSigner(rsa_key));
    signers.push(signer.addSigner(rsa_key2));
    Promise.all(signers).then(function() {

        signer.sign(plaintext.textContent, null, {}).then(function(message) {

            signtext.textContent = JSON.stringify(message, null, 4);
            var verifier = new JoseJWS.Verifier(cryptographer, message);
            verifier.addRecipient(rsa_key).then(function() {
                verifier.addRecipient(rsa_key2, null, "RS384").then(function() {
                    verifier.verify().then(function(verified) {
                        signtext.textContent += '\n\nverified: ' + JSON.stringify(verified, null, 4);
                    }).catch(function(err) {
                        error.textContent = "verification failed: " + err;
                    });
                });
            });
        }).catch(function(err) {
            error.textContent = "sign failed: " + err;
        });
    });

</script>
</body>
</html><commit_msg>passing right headers to addSigner<commit_after><html>
<body>
<p>payload: <span id="plaintext">hello world</span></p>

<p>signature:
<pre style="word-wrap: break-word" id="signtext"></pre>
</p>
<p>error: <span id="error" style="color: red"></span></p>
<script src="../dist/jose-jwe.js"></script>

<script>
    var rsa_key = {
        // n = modulus
        "n": "fc00:e968:6179::de52:7100:36:72:a7:91:0f:ee:30:a0:95:d5:3a:46:82:86:96:7e:42:c6:fe:8f:20:97:af:49:f6:48:a3:91:53:ac:2e:e6:ec:9a:9a:e0:0a:fb:1c:db:44:40:5b:8c:fc:d5:1c:cb:b6:9b:60:c0:a8:ac:06:f1:6b:29:5e:2f:7b:09:d9:93:32:da:3f:db:53:9c:2e:ea:3b:41:7f:6b:c9:7b:88:9f:2e:c5:dd:42:1e:7f:8f:04:f6:60:3c:fe:43:6d:32:10:ce:8d:99:cb:76:f7:10:97:05:af:28:1e:39:0f:78:35:50:7b:8e:28:22:a4:7d:11:51:22:d1:0e:ab:6b:6f:96:cb:cf:7d:eb:c6:aa:a2:6a:2e:97:2a:93:af:a5:89:e6:c8:bc:9f:fd:85:2b:0f:b4:c0:e4:ca:b5:a7:9a:01:05:81:93:6b:f5:8d:1c:f7:f3:77:0e:6e:53:34:92:0f:48:21:34:33:44:14:5e:4a:00:41:3a:7d:cb:38:82:c1:65:e0:79:ea:a1:05:84:b2:6e:40:19:77:1a:0e:38:4b:28:1f:34:b5:cb:ac:c5:2f:58:51:d7:ec:a8:08:0e:7c:c0:20:c1:5e:a1:4d:b1:30:17:63:0e:e7:58:8e:7f:6e:9f:a4:77:8b:1e:a2:d2:2e:1b:e9",

        // e = publicExponent
        "e": 65537,

        // d = privateExponent
        "d": "37:b6:4b:f4:26:17:a8:0b:3c:c5:1f:ab:59:b9:47:d2:ae:d9:8e:ee:4e:79:48:ab:0d:34:61:06:0f:78:8b:d4:ba:ef:6b:f4:7a:22:d8:c4:6f:70:89:5d:9c:b3:a1:8b:e8:88:57:dd:07:9e:c2:2b:12:52:a3:eb:b9:a8:24:01:7e:53:2b:7a:34:50:d7:0c:75:d8:69:a3:87:dd:4b:fc:c1:c3:2f:bd:0e:57:16:8d:ea:de:8e:de:ff:e4:9a:9f:aa:e8:d2:5f:b3:27:ef:f9:ca:50:97:2e:fd:99:1c:34:dd:0c:bb:dd:d0:b9:bf:4f:dc:9d:de:94:50:66:2c:58:7e:c2:31:8b:41:56:49:6a:e6:11:14:53:a1:45:0d:15:8b:26:79:0f:c9:dc:ac:dc:c7:bc:55:2c:96:ed:a7:29:09:04:ee:00:74:60:e1:bc:97:7b:0a:b6:f2:83:82:79:65:e0:aa:88:9f:90:b0:0d:76:4d:3c:08:7e:a5:05:19:d4:8b:54:d3:f1:c1:a3:e3:a5:1e:aa:d6:c4:94:ad:6c:b3:8f:85:06:8a:6f:52:f8:a3:c3:e0:8d:67:35:2f:d4:18:fc:70:f4:71:bf:18:88:d6:a7:b7:04:8fc00:db20:35b:7399::5:98:65:c9:41:2c:77:bf:4c:7c:8c:2c:01",

        // p = prime1
        "p": "00:fa:d6:06:46:5c:04:70:e6:ec:47:02:96:02:a5:e2:41:9d:bd:7b:97:28:a4:c5:3b:b5:9b:0a:6b:7d:b6:44:8a:28:1e:d1:ef:cb:44:ef:eb:4d:08:74:80:f5:cf:3b:b7:40:10:60:c9:18:1e:a5:76:4b:41:37:06:b2:71:03:60:25:77:db:d0:b2:21:dc:b0:32:90:a2:10:9a:d5:e6:e3:11:42:a1:9a:7a:26:3c:d3:12:56:db:25:07:69:be:ae:2c:b9:33:6c:29:e3:65:b9:5b:05:84:05:e6:da:c4:f4:3f:ab:84:60:6e:f0:5f:ba:a8:98:8f:72:2c:c8:40:d1",

        // q = prime2
        "q": "00:c6:4b:ac:fe:40:1c:dc:6c:78:07:cc:3e:db:4e:d5:d0:17:3b:8f:04:f0:ae:c4:22:0d:8b:0a:4d:0f:9e:fe:c7:e6:38:b5:53:ba:a9:e8:f0:47:28:14:25:95:6a:79:ab:db:86:97:82:c5:1e:bd:80:a5:aa:a2:b7:a5:c7:48:17:c4:d9:c7:4f:50:2a:69:67:15:4c:0b:f5:e6:fb:20:23:5d:ea:ae:6c:c6:74:ba:cc:f8:06:2b:41:1f:b6:3f:2a:93:fa:f9:e1:ee:93:c3:92:ad:49:c7:8f:db:72:ff:6b:f0:f0:d6:2f:83:ce:1c:82:16:89:57:01:9f:49:2f:99",

        // dp = exponent1
        "dp": "57:d4:c1:75:b9:9a:c4:7d:d7:96:35:cd:99:37:c4:b5:fd:29:f0:30:c9:c6:88:59:94:09:a9:e8:61:a8:84:ef:6b:84:ff:35:dc:13:53:7f:2d:06:1c:e5:5b:2d:29:57:cd:52:ee:d0:fb:65:1f:c3:00:2e:e1:b9:b2:99:e7:f8:ae:a5:fd:8e:62:11:fc00:db20:35b:7399::5:81:b9:58:bd:e0:20:5b:4d:30:57:28:40:c9:93:79:b9:09:4f:ab:d1:5d:b4:2e:26:b5:e3:e5:7f:54:ef:4c:1a:a6:84:70:16:fa:cf:59:89:49:bb:ee:75:1d:25:79:90:d5:41",

        // dq = exponent2
        "dq": "00:ab:eb:a8:8c:b7:21:4e:aa:6c:56:b6:6a:38:d1:dc:e6:91:7d:fd:bd:96:be:af:25:a7:00:49:6a:0e:85:16:f8:51:4e:11:48:0a:aa:8d:5e:e5:12:86:85:1f:4a:35:3b:1f:15:4d:fe:fe:d0:6c:14:41:8d:f3:8d:ad:99:5d:93:de:03:c2:9d:ad:2f:58:3b:1b:67:d7:66:d7:60:1a:b9:0f:10:0d:32:19:cd:d2:b7:2a:c2:8e:75:e3:fc:aa:3f:4c:15:68:d8:cd:74:27:37:e0:2d:fb:6b:6a:24:05:f7:9b:e9:f2:89:37:89:57:86:21:eb:e9:17:6a:f6:94:e1",

        // qi = coefficient
        "qi": "0a:ed:5f:30:67:d5:e5:6e:4a:7a:35:49:fe:16:2f:1e:91:2b:39:c3:01:d3:d4:c0:4d:b3:fc:08:b0:66:e9:44:10:9e:5b:5a:ea:83:a5:9c:95:7a:58:70:35:28:e5:4d:ba:19:de:0d:66:f9:db:5c:f6:5b:24:27:9d:0b:2d:44:40:eb:33:3a:19:e2:1d:c0:b0:16:99:d1:c1:52:84:02:d6:67:06:32:f8:4d:cb:42:9f:7c:8a:e0:ad:df:40:6f:e4:8c:f6:f6:9e:1d:bd:43:e3:38:91:a2:d0:9e:60:ff:9d:8c:fb:72:5b:df:95:30:17:d2:f2:cb:7d:92:56:0a"
    };

    var rsa_key2 = {
        "n": "02:6f:cb:5a:12:79:81:c0:b7:03:ad:b8:eb:20:a3:2f:5c:26:09:ab:4e:e1:e9:66:05:2c:36:84:b2:21:76:3a:65:ce:8b:b3:4e:fd:51:03:ea:98:4d:f8:8d:ab:cc:1b:60:a6:3b:6b:85:85:74:3b:72:7f:04:d0:a6:18:a8:b4:e9:44:c0:ff:92:a0:79:61:d8:ad:ab:4a:d0:cf:ae:e3:8b:48:d5:7e:70:96:68:0e:a3:e2:ad:9d:1d:02:94:a6:15:81:19:07:5a:60:7a:6d:c0:f1:97:ec:4e:bc:e1:9d:d0:9a:b1:d9:8f:2e:62:e8:b4:5f:a1:ef:fb:7d:02:c2:c0:14:c9:82:fb:a0:1b",
        "e": 65537,
        "d": "01:e9:6a:97:e9:e4:d1:6b:bd:6b:b2:72:62:70:41:f8:57:89:34:8e:e6:9e:12:fc:4b:54:ac:15:a2:98:e4:64:df:19:95:bc:02:5e:77:a0:e5:ff:c7:35:1b:1a:4e:52:b0:9a:dc:05:f9:45:82:b3:5d:9a:d0:d1:4f:70:0b:75:9d:8b:a7:0a:aa:9b:06:7d:68:df:96:09:54:7a:84:b0:4f:8d:42:8a:58:44:2a:94:9f:46:b0:1f:03:11:90:aa:d3:d1:12:e0:38:38:54:4b:5f:8a:e4:cb:2f:f4:73:2a:f3:06:4d:49:e4:4d:5c:8a:4b:86:69:69:1c:f3:03:2d:01:57:98:d3:cf:e2:99",
        "p": "01:9f:6b:9a:2c:1f:1e:6e:4a:a3:a5:00:e8:e6:1a:be:30:41:e2:66:3e:be:b5:81:0a:d2:d4:0e:d1:86:bf:4a:e3:1d:20:ac:6a:fb:a1:cd:0c:db:2a:2d:09:27:c7:d3:81:e0:f0:08:10:8e:18:21:17:d3:61:a0:5d:76:6a:7f:4f:27:d7:0d",
        "q": "01:80:68:ba:c8:93:2c:79:e6:8e:f5:8d:0f:8c:b3:af:24:96:19:2c:d4:43:23:54:48:78:36:42:d0:a3:12:16:a0:03:ac:3a:77:e9:17:a1:8a:0c:4a:a9:b5:cf:cb:b6:6a:d4:ad:8b:88:65:34:e4:aa:2e:78:18:e0:02:9e:fe:09:44:09:c7",
        "dp": "22:4e:1c:79:30:48:af:0a:f2:e0:99:66:a2:39:eb:22:c9:0e:0d:2b:79:4c:3b:cf:cd:01:3e:08:07:7c:9c:8e:8c:c5:39:f7:cb:b7:dc:db:06:ee:40:b1:d4:db:27:98:3e:1f:14:4b:69:b0:8c:6b:0f:45:ac:9c:8b:3e:d8:2c:8d:39:b1",
        "dq": "00:f3:5c:5a:33:b5:08:c9:3b:af:71:c1:16:01:0b:98:6b:df:22:9d:00:dc:68:37:69:91:c1:38:57:81:85:68:11:71:81:cd:9a:30:55:27:8d:8f:ee:8c:b6:6f:91:16:31:57:e7:6e:98:b1:09:e5:61:df:fd:64:32:1d:36:ae:b9:0a:fb:ed",
        "qi": "0f:a9:06:b8:51:44:98:84:9e:d7:92:5f:0d:24:0a:f0:3f:e1:bb:86:52:93:e5:b4:53:c9:6c:0a:da:ef:70:1b:83:99:a4:9a:15:e8:cb:43:5b:f7:14:9b:d5:a0:8c:0d:47:c0:af:22:c4:d7:91:73:82:97:f4:3a:eb:a8:01:cd:61:a4:f8"
    };

    var cryptographer = new Jose.WebCryptographer();
    cryptographer.setContentSignAlgorithm("RS256");

    var signer = new JoseJWS.Signer(cryptographer);

    var signers = [];
    signers.push(signer.addSigner(rsa_key));
    signers.push(signer.addSigner(rsa_key2, null, {alg: 'RS384'}));
    Promise.all(signers).then(function () {

        signer.sign(plaintext.textContent, null, {}).then(function (message) {

            signtext.textContent = JSON.stringify(message, null, 4);
            var verifier = new JoseJWS.Verifier(cryptographer, message);
            verifier.addRecipient(rsa_key).then(function () {
                verifier.addRecipient(rsa_key2, null, "RS384").then(function () {
                    verifier.verify().then(function (verified) {
                        signtext.textContent += '\n\nverified: ' + JSON.stringify(verified, null, 4);
                    }).catch(function (err) {
                        error.textContent = "verification failed: " + err;
                    });
                });
            });
        }).catch(function (err) {
            error.textContent = "sign failed: " + err;
        });
    });

</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.288972602739726, 'fraction_numerical': 0.30294520547945203, 'mean_word_length': 9.153685674547983, 'pattern_counts': {'":': 32, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5604588', 'n_tokens_mistral': 11449, 'n_tokens_neox': 10041, 'n_words': 252}