As far as I understand, go-jose implements the JSON Web Signature (JWS) Unencoded Payload Option (https://www.rfc-editor.org/rfc/rfc7797) via the SigningOption: func (*SignerOptions) WithBase64.
I tried setting this option via: opt := (&jose.SignerOptions{}).WithBase64(false), but it still leads to a base64 encoded payload when using full serialization. The option is indeed evaluated and the payload is not base64 encoded in signing.go (https://github.com/square/go-jose/blob/v2/signing.go#L291), but then, in the FullSerialize() the rawJSONWebSignature containing a Payload *byteBuffer is serialized.
As far as I understand, go-jose implements the JSON Web Signature (JWS) Unencoded Payload Option (https://www.rfc-editor.org/rfc/rfc7797) via the SigningOption:
func (*SignerOptions) WithBase64
.I tried setting this option via:
opt := (&jose.SignerOptions{}).WithBase64(false)
, but it still leads to a base64 encoded payload when using full serialization. The option is indeed evaluated and the payload is not base64 encoded in signing.go (https://github.com/square/go-jose/blob/v2/signing.go#L291), but then, in theFullSerialize()
therawJSONWebSignature
containing aPayload *byteBuffer
is serialized.For the
byteBuffer
, a custom JSON Marshalling method is implemented in encoding.go (https://github.com/square/go-jose/blob/v2/encoding.go#L142) and this method always encodes base64:Did I do something wrong using the WithBase64() option or doesn't this mean setting WithBase64 still leads to base64-encoded payload?