// Sign a JWT token using x509 cert and key
Sign a JWT token using x509 cert and key
// Sign a JWT token using x509 cert and key
func signAuthJwt(payload map[string]interface{}) (string, error) {
	fingerprint := sha1.Sum(auth_x509_cert_parsed.Raw)
	fingerprintB64 := b64.StdEncoding.EncodeToString(fingerprint[:])
	s, err := jose.NewSigner(
		jose.SigningKey{
			Algorithm: jose.RS256,
			Key:       auth_x509_key_parsed,
		},
		&jose.SignerOptions{
			ExtraHeaders: map[jose.HeaderKey]interface{}{
				"x5t": fingerprintB64,
			},
		},
	)
	if err != nil {
		return "", err
	}
	return jwt.Signed(s).Claims(payload).CompactSerialize()
}
func signAuthJwt ( payload map [ string ] interface { } ) ( string , error ) { fingerprint := sha1 . Sum ( auth_x509_cert_parsed . Raw ) fingerprintB64 := b64 . StdEncoding . EncodeToString ( fingerprint [ : ] ) s , err := jose . NewSigner ( jose . SigningKey { Algorithm : jose . RS256 , Key : auth_x509_key_parsed , } , & jose . SignerOptions { ExtraHeaders : map [ jose . HeaderKey ] interface { } { " " : fingerprintB64 , } , } , ) if err != nil { return " " , err } return jwt . Signed ( s ) . Claims ( payload ) . CompactSerialize ( ) }
Sign a JWT token using x509 cert and key
Sign a JWT token using x509 cert and key