def get_cert_keyid(gid):
    """Extract the subject key identifier from the given certificate.
    Return they key id as lowercase string with no colon separators
    between pairs. The key id as shown in the text output of a
    certificate are in uppercase with colon separators.

    """
    raw_key_id = gid.get_extension('subjectKeyIdentifier')
    # Raw has colons separating pairs, and all characters are upper case.
    # Remove the colons and convert to lower case.
    keyid = raw_key_id.replace(':', '').lower()
    return keyid