def _find_extension(asn1, extn_id):
    """Find an extension from a certificate's ASN.1 representation

    Args:
        asn1: x509.Certificate instance.
        extn_id: OID of the extension to look for.

    Returns:
        The decoded value of the extension, or None if not found.
        This is a reference and can be modified.
    """
    for e in asn1["tbsCertificate"]["extensions"]:
        if e["extnID"] == extn_id:
            return e["extnValue"].decoded_value

    return None