def METHOD_NAME(self, is_private=False, **params):
    """Represent this key as a dict of the JSON Web Key."""
    tokens = self.tokens
    if is_private and 'd' not in tokens:
        raise ValueError('This is a public key')
    kid = tokens.get('kid')
    if 'd' in tokens and not is_private:
        # filter out private fields
        tokens = {k: tokens[k] for k in tokens if k in self.PUBLIC_KEY_FIELDS}
        tokens['kty'] = self.kty
        if kid:
            tokens['kid'] = kid
    if not kid:
        tokens['kid'] = self.thumbprint()
    tokens.update(params)
    return tokens