TimothyClaeys / pycose

A Python implementation of the COSE specification (CBOR Object Signing and Encryption) described in RFC 8152.
https://tools.ietf.org/html/rfc8152
Other
39 stars 24 forks source link

Modify unprotected header after signing #82

Closed letmaik closed 2 years ago

letmaik commented 2 years ago

pycose doesn't allow to modify the unprotected header of an already signed message. Being able to do so is useful for countersigning, since the countersignature is computed based on the original signature and then embedded as new parameter in the unprotected header. Decoding an existing message followed by msg.encode(sign=False) strips the original signature instead of retaining it.