From 71de8c7d51cd9bf71b6aa46665ec19d87a6f18c9 Mon Sep 17 00:00:00 2001 From: David Hontecillas Date: Mon, 6 May 2024 19:34:12 +0200 Subject: [PATCH] expose a function to check a supported algorithm --- jose.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jose.go b/jose.go index fed6980..f159b5b 100644 --- a/jose.go +++ b/jose.go @@ -353,6 +353,11 @@ var supportedAlgorithms = map[string]jose.SignatureAlgorithm{ "PS512": jose.PS512, } +func SupportedAlgorithm(s string) (jose.SignatureAlgorithm, bool) { + a, ok := supportedAlgorithms[s] + return a, ok +} + func convertToStringSlice(input []interface{}) []string { result := make([]string, len(input))