<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clear_to_enc_filename(fname):
 """ Converts the filename of a cleartext file and convert it to an encrypted filename :param fname: :return: filename of encrypted secret file if found, else None """

    if not fname.lower().endswith('.json'):
        raise CredkeepException('Invalid filetype')

    if fname.lower().endswith('.enc.json'):
        raise CredkeepException('File already encrypted')

    enc_fname = fname[:-4] + 'enc.json'

    return enc_fname if exists(enc_fname) else None