var signingMethods … var signingMethodLock … type SigningMethod … // RegisterSigningMethod registers the "alg" name and a factory function for signing method. // This is typically done during init() in the method's implementation func RegisterSigningMethod(alg string, f func() SigningMethod) { … } // GetSigningMethod retrieves a signing method from an "alg" string func GetSigningMethod(alg string) (method SigningMethod) { … } // GetAlgorithms returns a list of registered "alg" names func GetAlgorithms() (algs []string) { … }