Open saibotsivad opened 8 years ago
Note that if we specify the hashing/signing algorithm in the container, e.g. alg: 'HS512'
as it is currently in 0.12
, then we will probably want to specify the hashing/signing/encryption algorithm in the other core containers.
I am leaning towards the proposed solution, which would essentially ditch trying to use the JWS specs. Currently we aren't using them for much else anyway, so it would clean things up a bit.
In any case, the 0.12
specs do not make it clear at all what is being signed and how. This must be remedied.
Currently the signature schema has the following layout:
This was originally meant to mimic the JWS protected headers specs.
However, since the hashing method and algorithm are being specified in the specs, why not just make the
signatures
object like:And make the signature algorithm like:
So that, for example, if we had:
GlvAreTo0lCSyum7Wzh8pzhxYOOu-gMIgO2N95AAwAGP6-nR8xCvWvIW0t9rF_ZZfpCY_fDV38JDFKaOU91A8Q
7zK3dKa-p1AjDHyKolzWWVT0lMnyEMFCfNZct-FQE97KemrnYTRkvn5bjqgQiS400z4R1lP8mUvAaCduW4JBIw
Then we would put the two together:
And take the hash of that:
And then sign that.