def parse_certinfo(certinfo):
    """ Parses the certinfo generated by the sslyze and returns a dict    """

    tmp_certinfo = {}
    for key,val in certinfo.iteritems():

        if key in ['path_validation_result_list','server_info','plugin_command','plugin_options']:
            """ ignore this info """
            pass

        elif key in ['certificate_chain','verified_certificate_chain']:
            if key == 'verified_certificate_chain':
                count = 0
                tmp_chain = {}
                for cert in val:
                    # only store pem for now
                    #tmp_chain[count] = {'pem': cert.as_pem, 'sha1_fingerprint':cert.sha1_fingerprint, 'dict': cert.as_dict}
                    tmp_chain[count] = {'pem': cert.as_pem,
                            'sha1_fingerprint':cert.sha1_fingerprint, 'hpkp_pin':cert.hpkp_pin}
                    count += 1
                tmp_certinfo[key] = tmp_chain
        else:
            tmp_certinfo[key] = val

    return tmp_certinfo