def update(self):
        """
        Reload the keys if necessary
        This is a forced update, will happen even if cache time has not elapsed.

        Replaced keys will be marked as inactive and not removed.        
        """
        res = True  # An update was successful
        if self.source:
            _keys = self._keys  # just in case

            # reread everything
            self._keys = []

            try:
                if self.remote is False:
                    if self.fileformat in ["jwks", "jwk"]:
                        self.do_local_jwk(self.source)
                    elif self.fileformat == "der":
                        self.do_local_der(self.source, self.keytype,
                                          self.keyusage)
                else:
                    res = self.do_remote()
            except Exception as err:
                logger.error('Key bundle update failed: {}'.format(err))
                self._keys = _keys  # restore
                return False

            now = time.time()
            for _key in _keys:
                if _key not in self._keys:
                    if not _key.inactive_since:  # If already marked don't mess
                        _key.inactive_since = now
                    self._keys.append(_key)

        return res
def update ( self ) : res = True if self . source : _keys = self . _keys self . _keys = [ ] try : if self . remote is False : if self . fileformat in [ "jwks" , "jwk" ] : self . do_local_jwk ( self . source ) elif self . fileformat == "der" : self . do_local_der ( self . source , self . keytype , self . keyusage ) else : res = self . do_remote ( ) except Exception as err : logger . error ( 'Key bundle update failed: {}' . format ( err ) ) self . _keys = _keys return False now = time . time ( ) for _key in _keys : if _key not in self . _keys : if not _key . inactive_since : _key . inactive_since = now self . _keys . append ( _key ) return res
Reload the keys if necessary
        This is a forced update, will happen even if cache time has not elapsed.

        Replaced keys will be marked as inactive and not removed.