From 439842e65636850e159a9f770412c5cef47f2ecd Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Sep 10 2016 11:18:27 +0000 Subject: Use JWKSet.export if it is available This function was released as part of the jwcrypto 0.3.0 release, so if it is available, that function is prefered over our manual building of the keyset. Signed-off-by: Patrick Uiterwijk Reviewed-by: Howard Johnson --- diff --git a/ipsilon/providers/openidc/auth.py b/ipsilon/providers/openidc/auth.py index c48d9ef..6e4b53d 100644 --- a/ipsilon/providers/openidc/auth.py +++ b/ipsilon/providers/openidc/auth.py @@ -743,6 +743,10 @@ class OpenIDC(ProviderPageBase): 'Content-Type': 'application/json' }) + if 'export' in dir(self.cfg.keyset): + # This function was added to jwcrypto 0.3.0 + return self.cfg.keyset.export(private_keys=False) + # Sent to jwcrypto as https://github.com/latchset/jwcrypto/pull/20 keys = [] for key in self.cfg.keyset: