From 63a6656957ba14c57795cb1483dccf933f0c4148 Mon Sep 17 00:00:00 2001 From: Wisdom Matthew Date: Thu, 26 Aug 2021 19:11:26 +0100 Subject: [PATCH] Add `GetSigningMethods` function Signed-off-by: Wisdom Matthew --- signing_method.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/signing_method.go b/signing_method.go index 3269170f..e336b768 100644 --- a/signing_method.go +++ b/signing_method.go @@ -33,3 +33,14 @@ func GetSigningMethod(alg string) (method SigningMethod) { } return } + +// GetSigningMethods retrieves all registered signing methods +func GetSigningMethods() (methods []SigningMethod) { + signingMethodLock.RLock() + defer signingMethodLock.RUnlock() + + for _, method := range signingMethods { + methods = append(methods, method()) + } + return methods +}