@@ -107,7 +107,7 @@ def ec_init(spec):
107107
108108class KeyBundle (object ):
109109 def __init__ (self , keys = None , source = "" , cache_time = 300 , verify_ssl = True ,
110- fileformat = "jwk " , keytype = "RSA" , keyusage = None , kid = '' ):
110+ fileformat = "jwks " , keytype = "RSA" , keyusage = None , kid = '' ):
111111 """
112112 Contains a set of keys that have a common origin.
113113 The sources can be serveral:
@@ -120,7 +120,7 @@ def __init__(self, keys=None, source="", cache_time=300, verify_ssl=True,
120120 with the keys ["kty", "key", "alg", "use", "kid"]
121121 :param source: Where the key set can be fetch from
122122 :param verify_ssl: Verify the SSL cert used by the server
123- :param fileformat: For a local file either "jwk " or "der"
123+ :param fileformat: For a local file either "jwks " or "der"
124124 :param keytype: Iff local file and 'der' format what kind of key it is.
125125 presently only 'rsa' is supported.
126126 :param keyusage: What the key loaded from file should be used for.
@@ -332,7 +332,7 @@ def update(self):
332332
333333 try :
334334 if self .remote is False :
335- if self .fileformat == "jwks" :
335+ if self .fileformat in [ "jwks" , "jwk" ] :
336336 self .do_local_jwk (self .source )
337337 elif self .fileformat == "der" :
338338 self .do_local_der (self .source , self .keytype ,
@@ -347,9 +347,7 @@ def update(self):
347347 now = time .time ()
348348 for _key in _keys :
349349 if _key not in self ._keys :
350- try :
351- _key .inactive_since # If already marked don't mess
352- except ValueError :
350+ if not _key .inactive_since : # If already marked don't mess
353351 _key .inactive_since = now
354352 self ._keys .append (_key )
355353
0 commit comments