class CertificateValidityChecker {

    public Optional<CertificateValidity> validate(Certificate certificate) {
        return certificate.getX509Certificate()
                .map(x509 -> getCertificateValidity(certificate, x509));
    }

    private  CertificateValidityChecker(TrustStoreForCertificateProvider trustStoreForCertificateProvider, CertificateChainValidator certificateChainValidator);

}