Skip to content

v1.2.16

Compare
Choose a tag to compare
@lestrrat lestrrat released this 12 Jan 05:30
· 39 commits to main since this release
v1.2.16 12 Jan 2022
[Bug Fixes]
  * Peviously, `jws.Sign()` could not create a signed payload with
    detached and unencoded payload, even when the documentation said it could.
    Now you may use the `jws.Sign()` in the following way to create
    a JWS message with detached, unencoded state:

       hdrs := jws.NewHeaders()
       hdrs.Set("b64", false)
       hdrs.Set("crit", "b64")
       jws.Sign(nil, alg, key, jws.WithDetachedPayload(payload), jws.WithHeaders(hdrs))

    Notice the use of `nil` for the first parameter, and the use of
    `jws.WithDetachedPayload()`.

    We realize this is not exactly a clean API, but this is currently the
    only way to implement this in a backward-compatible fashion. Most likely
    this will change in a future major version.
[Miscellaneous]
  * `jws.WithDetachedPayload()` is now of type `jws.SignVerifyOption`, which
    satisfies both `jws.SignOption` and `jws.VerifyOption