Code example for X509TrustManager

Methods: checkClientTrusted

0
            return trustManager;
        } 
 
        public void checkClientTrusted(X509Certificate[] chain, String authType)
        throws CertificateException { 
            defaultTrustManager.checkClientTrusted(chain, authType);
        } 
 
        public void checkServerTrusted(X509Certificate[] chain, String authType)
        throws CertificateException { 
            // FIXME: Using a static field to store the certificate chain is a bad idea. Instead 
            // create a CertificateException subclass and store the chain there. 
            TrustManagerFactory.setLastCertChain(chain);
            try { 
                defaultTrustManager.checkServerTrusted(chain, authType);
            } catch (CertificateException e) {
                localTrustManager.checkServerTrusted(new X509Certificate[] {chain[0]}, authType);
            } 
            if (!DomainNameChecker.match(chain[0], mHost)) {
                try { 
                    String dn = chain[0].getSubjectDN().toString();