Return the number of Signed Certificate Timestamps (SCTs) embedded in the certificate.

def count_scts_in_sct_extension(certificate: cryptography.x509.Certificate) -> Optional[int]:
        """Return the number of Signed Certificate Timestamps (SCTs) embedded in the certificate.
        """
        scts_count = 0
        try:
            # Look for the x509 extension
            sct_ext = certificate.extensions.get_extension_for_oid(
                ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS
            )

            if isinstance(sct_ext.value, cryptography.x509.UnrecognizedExtension):
                # The version of OpenSSL on the system is too old and can't parse the SCT extension
                return None

            # Count the number of entries in the extension
            scts_count = len(sct_ext.value)
        except ExtensionNotFound:
            pass

        return scts_count