func (so *SignerOptions) WithType(typ ContentType) *SignerOptions {
	return so.WithHeader(HeaderType, typ)
}
WithType adds a type ("typ") header and returns the updated SignerOptions.
package jose
import (
	"bytes"
	"crypto/ecdsa"
	"crypto/rsa"
	"encoding/base64"
	"errors"
	"fmt"
	"golang.org/x/crypto/ed25519"
	"gopkg.in/square/go-jose.v2/json"
)
type NonceSource interface {
	Nonce() (string, error)
}
type Signer interface {
	Sign(payload []byte) (*JSONWebSignature, error)
	Options() SignerOptions
}
type SigningKey struct {
	Algorithm SignatureAlgorithm
	Key       interface{}
}
type SignerOptions struct {
	NonceSource NonceSource
	EmbedJWK    bool
	ExtraHeaders map[HeaderKey]interface{}
}
func (so *SignerOptions) WithHeader(k HeaderKey, v interface{}) *SignerOptions {
	if so.ExtraHeaders == nil {
		so.ExtraHeaders = map[HeaderKey]interface{}{}
	}
	so.ExtraHeaders[k] = v
	return so
}
func (so *SignerOptions) WithContentType(contentType ContentType) *SignerOptions {
	return so.WithHeader(HeaderContentType, contentType)
}