RegisterSigningMethod registers the "alg" name and a factory function for signing method. This is typically done during init() in the method's implementation
(alg string, f func() SigningMethod)
| 20 | // RegisterSigningMethod registers the "alg" name and a factory function for signing method. |
| 21 | // This is typically done during init() in the method's implementation |
| 22 | func RegisterSigningMethod(alg string, f func() SigningMethod) { |
| 23 | signingMethodLock.Lock() |
| 24 | defer signingMethodLock.Unlock() |
| 25 | |
| 26 | signingMethods[alg] = f |
| 27 | } |
| 28 | |
| 29 | // GetSigningMethod retrieves a signing method from an "alg" string |
| 30 | func GetSigningMethod(alg string) (method SigningMethod) { |