Closed cyberphone closed 6 years ago
without forcing the signed data to move one level down to a separate object
Is this a critical requirement? It seems like if it is not then JCS doesn't add much to JWS or am I missing something?
@adrianhopebailie This issue only describes a possible extension to JCS, enabling a straightforward way dealing with Signed and Unsigned JSON data.
How you would do that using JWS is hard to tell without having a specification.
@mattsaxon Here is the same thing in a JCS version in preparation which adopts the JWS attributes, JWK, and JWA:
{
"aSignedProperty": "something",
"anUnsignedProperty": "something else",
"signature": {
"alg": "ES256",
"jwk": {
"kty": "EC",
"crv": "P-256",
"x": "_gow8fcS3Dx9z6j57U5q8tunnRBdrgLU9A7CZTYCnqU",
"y": "bdfJGraBVL5aPj38TG4tHwxpU2VKwG1XBp0wQfCLOFQ"
},
"excl": ["anUnsignedProperty"],
"val": "nVnZtJUdUktFRdDLEchf .... tfe7j-jhirzZ9t50qSvLudpo2pw"
}
}
Compared to the original JWS, both the Data and the Header (keys, algorithms) are in clear.
@cyberphone,
I'm closing this issue here since the signature work in the task force has moved to another repo and feedback here has slowed.
This is actually an attempt getting feedback on a generic proposal I'm working on. I believe that it could be used in your application as well...
The current scheme called JCS offers clear text JSON signatures like this:
where
"merchantId"
and"amount"
are signed.The proposal for adding support for unsigned data (without forcing the signed data to move one level down to a separate object), is introducing an
"excluded"
property holding an array of properties that should be excluded in the signature process:That is, the
"excluded"
property itself as well as the properties it refers to (here"someOtherData"
) would be excluded from the signature canonicalization/normalization process. You can safely delete them from the JSON object after consumption and the signature should validate anyway.