code: private static boolean isCritical(final X509Certificate certificate, final String extensionOid) {
          val criticalOids = certificate.getCriticalExtensionOIDs();
          if (criticalOids == null || criticalOids.isEmpty()) {
              return false;
          }
          return criticalOids.contains(extensionOid);
      }
docs: Checks if critical extension oids contain the extension oid.
  
  @param certificate  the certificate
  @param extensionOid the extension oid
  @return true, if  critical