TBD54566975 / web5-go

Apache License 2.0
10 stars 6 forks source link

Add parameterization for jws.Sign() for 'typ' header #36

Closed KendallWeihe closed 6 months ago

KendallWeihe commented 6 months ago

@mistermoe I whipped this together kind of in a flash so lmk if I'm totally off base

Originally motivated by the fact that the proof JWT in OID4VCI needs to be explicitly typed with the value openid4vci-proof+jwt

The premise here being, we added a Type property to the jws.Header type, but the call to jws.Sign() builds the Header dynamically from the relative material from the DID Document... a few thoughts...

Idk I'm a little out of my depth here so feel free to propose an entirely different direction

KendallWeihe commented 6 months ago

lmk what we think about this idea, I can do that pretty quickly here

maybe we should rename jws.Sign() to something like jws.DIDSign() which builds the header from the given DID document and then we keep a function named jws.Sign() which takes in a header a payload and just does the signing (jws.DIDsign() would call jws.Sign())