class Crypto {

    public static boolean isRestrictedCertificate(X509Certificate x509Cert, GlobStringsMatcher globStringsMatcher) {
        if (globStringsMatcher == null) {
            LOG.error("isRestrictedCertificate: Required argument globStringsMatcher is null. Returning true.");
            return true;
        }
        if (x509Cert == null) {
            LOG.error("isRestrictedCertificate: Required argument x509Cert is null. Returning true.");
            return true;
        }
        if (globStringsMatcher.isEmptyPatternsList()) {
            // No patterns provided, no need to check for mTLS restriction
            return false;
        }

        String x509Ou = extractX509CertSubjectOUField(x509Cert);
        return globStringsMatcher.isMatch(x509Ou);
    }

}