jsonjwtjson-web-signature

What is a use case for having multiple signatures in a JWS that uses JWS JSON Serialization?


I read the JSON Web Signature specification that can be found here. The spec defines two serialization representations for JSON Web Signatures. One is the JWS Compact Serialization and the other is JWS JSON Serialization method. The JWS JSON Serialization representation allows one to have multiple signatures. An example of a JWS that uses JWS JSON Serialization is:

{
        "payload": "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFtcGxlLmNvbS9pc19yb290Ijp0cnVlfQ",
        "signatures": [
            {
                "protected": "eyJhbGciOiJSUzI1NiJ9",
                "header": {
                    "kid": "2010-12-29"
                },
                "signature": "cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7AAuHIm4Bh
                -0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4BAynRFdiuB
                --f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO
                --xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6Lbg
                GY9Fs98rqVt5AXLIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw"
            },
            {
                "protected": "eyJhbGciOiJFUzI1NiJ9",
                "header": {
                    "kid": "e9bc097a-ce51-4036-9562-d2ade882db0d"
                },
                "signature": "DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSApmWQxfKTUJqPP3-Kg6NU1Q"
            }
        ]
    }

The spec implies that it can be beneficial at times to have multiple signatures. However, I can't for the life of me think of a reason you'd need to have more than one.

So, with that being said what is a use case of having more than one signature in a JWS?


Solution

  • According to Florent Morselli's comment, there are at least 2 use cases:

    1. You sign a token with several signature algorithms (let say RS256, ES384 and PS512). depending on the audience capabilities (only supports ES384 algorithm), it will be able to verify the token.

    2. Several parties agree for a common payload. Each party sign the payload with its key and signatures are merged into a single token.