Code example for X509TrustManager

Methods: checkClientTrusted

0
	 * Delegate to the default trust manager. 
	 */ 
	public void checkClientTrusted(X509Certificate[] chain, String authType)
	throws CertificateException { 
		try { 
			defaultTrustManager.checkClientTrusted(chain, authType);
		} catch (CertificateException excep) {
			Log.e(CustomTrustManager.class.getName(), "checkClientTrusted failed", excep);
		} 
	} 
 
	/* 
	 * Delegate to the default trust manager. 
	 */ 
	public void checkServerTrusted(X509Certificate[] chain, String authType)
	throws CertificateException, NewCertificateException { 
		try { 
			defaultTrustManager.checkServerTrusted(chain, authType);
		} catch (CertificateException excep) {
			/* Here we either check the certificate against the last stored one, 
			 * or throw a security exception to let the user know that something is wrong.