List of usage examples for java.security.cert X509Certificate hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension();
From source file:com.sk89q.mclauncher.security.X509KeyStore.java
/** * Check if a server certificate chain is trusted. *///from w w w .ja v a2 s. c o m @Override public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { for (X509Certificate cert : chain) { cert.checkValidity(); if (cert.hasUnsupportedCriticalExtension()) { throw new CertificateException("Unsupported critical extension found"); } } try { verify(chain); } catch (CertificateVerificationException e) { throw new CertificateException("Verification error: " + e.getMessage(), e); } catch (CertPathBuilderException e) { throw new CertificateException(e.getMessage(), e); } }