def get_cert_serial(cert_file):
    cmd = "certutil.exe -verify {0}".format(cert_file)
    out = __salt__['cmd.run'](cmd)
    matches = re.search(r"Serial: (.*)", out)
    if matches is not None:
        return matches.groups()[0].strip()
    else:
        return None
Get the serial number of a certificate file
dataset/ETHPy150Open saltstack/salt/salt/modules/win_certutil.py/get_cert_serial