private static void addTlsMetrics(String certChain, String truststoreCerts, Meter meter, String prefix) throws CertificateException {
        // Parse and check the certificate expiration time
        X509Certificate[] serverCerts = parseCertificates(certChain);
        X509Certificate[] trustStoreCerts = parseCertificates(truststoreCerts);

        for (X509Certificate cert : serverCerts) {
            registerCertMetrics(meter, cert, "server_cert", prefix);
        }
        for (X509Certificate cert : trustStoreCerts) {
            registerCertMetrics(meter, cert, "truststore_cert", prefix);
        }
    }
Add TLS certificate metrics.

@param certChain       The certificate chain in PEM format.
@param truststoreCerts The truststore certificates in PEM format.
@param meter           The OpenTelemetry meter to use for creating metrics.
@param prefix          The prefix for the metric names.
server-common/src/main/java/org/apache/kafka/server/metrics/s3stream/S3StreamKafkaMetricsManager.java