You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: fakejwt.go
    path of file: ./repos/juju/apiserver/testing
    
    the code of the file until where you have to start completion: // Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.

package testing

import (
	"crypto/rand"
	"crypto/rsa"
	"crypto/x509"
	"encoding/pem"
	"time"

	"github.com/google/uuid"
	"github.com/juju/errors"
	"github.com/lestrrat-go/jwx/v2/jwa"
	"github.com/lestrrat-go/jwx/v2/jwk"
	"github.com/lestrrat-go/jwx/v2/jwt"
)

// JWTParams are the necessary params to issue a ready-to-go JWT.
type JWTParams struct {
	Controller string
	User       string
	Access     map[string]string
}

func getJWKS() (jwk.Set, []byte, error) {
	keySet, err := rsa.GenerateKey(rand.Reader, 4096)
	if err != nil {
		return nil, nil, errors.Trace(err)
	}

	privateKeyPEM := pem.EncodeToMemory(
		&pem.Block{
			Type:  "RSA PRIVATE KEY",
			Bytes: x509.MarshalPKCS1PrivateKey(keySet),
		},
	)

	kid, err := uuid.NewRan
    
func EncodedJWT(params JWTParams, jwkSet jwk.Set, signingKey jwk.Key) ([]byte, error) {
	jti, err := generateJTI()
	if err != nil {
		return nil, errors.Trace(err)
	}
	pubKey, ok := jwkSet.Key(jwkSet.Len() - 1)
	if !ok {
		return nil, errors.Errorf("no jwk found")
	}

	err = signingKey.Set(jwk.AlgorithmKey, jwa.RS256)
	if err != nil {
		return nil, errors.Trace(err)
	}
	err = signingKey.Set(jwk.KeyIDKey, pubKey.KeyID())
	if err != nil {
		return nil, errors.Trace(err)
	}

	token, err := jwt.NewBuilder().
		Audience([]string{params.Controller}).
		Subject(params.User).
		Issuer("test").
		JwtID(jti).
		Claim("access", params.Access).
		Expiration(time.Now().Add(time.Hour)).
		Build()
	if err != nil {
		return nil, errors.Trace(err)
	}

	freshToken, err := jwt.Sign(
		token,
		jwt.WithKey(
			jwa.RS256,
			signingKey,
		),
	)
	return freshToken, errors.Trace(err)
}