Code example for CertificateException

0
  } 
 
  public void checkClientTrusted(X509Certificate[] chain, String authType)
    throws CertificateException  
  { 
    throw new CertificateException("Client certificates not supported!");
  } 
 
  public void checkServerTrusted(X509Certificate[] chain, String authType)
    throws CertificateException  
  { 
    for (TrustManager systemTrustManager : systemTrustManagers) {
      ((X509TrustManager)systemTrustManager).checkServerTrusted(chain, authType);				
    } 
 
    X509Certificate anchor = this.systemKeyStore.getTrustRoot(chain);
 
    for (X509Certificate certificate : chain) {
      if (isValidPin(certificate))
	return; 
    }