Code example for NoSuchAlgorithmException

0
		super(); 
		TrustManagerFactory factory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
		factory.init(keystore);
		TrustManager[] trustmanagers = factory.getTrustManagers();
		if (trustmanagers.length == 0) {
			throw new NoSuchAlgorithmException("no trust manager found");
		} 
		this.standardTrustManager = (X509TrustManager) trustmanagers[0];
	} 
 
	/** 
	 * @see javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[],String authType) 
	 */ 
	public void checkClientTrusted(X509Certificate[] certificates, String authType) throws CertificateException {
		standardTrustManager.checkClientTrusted(certificates, authType);
	} 
 
	/** 
	 * @see javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[],String authType) 
	 */ 
	public void checkServerTrusted(X509Certificate[] certificates, String authType) throws CertificateException {