1 23 package com.sun.appserv.management.client; 24 25 import java.security.cert.X509Certificate ; 26 import java.security.cert.CertificateException ; 27 import java.io.IOException ; 28 29 import javax.net.ssl.X509TrustManager; 30 31 32 38 public final class TrustAnyTrustManager implements X509TrustManager 39 { 40 private static TrustAnyTrustManager INSTANCE = null; 41 private static TrustAnyTrustManager[] INSTANCE_ARRAY = null; 42 43 private TrustAnyTrustManager() {} 44 45 48 public static synchronized TrustAnyTrustManager 49 getInstance() 50 { 51 if ( INSTANCE == null ) 52 { 53 INSTANCE = new TrustAnyTrustManager(); 54 INSTANCE_ARRAY = new TrustAnyTrustManager[] { INSTANCE }; 55 } 56 return( INSTANCE ); 57 } 58 59 62 public static TrustAnyTrustManager[] 63 getInstanceArray() 64 { 65 getInstance(); 66 return( INSTANCE_ARRAY ); 67 } 68 69 72 public void 73 checkClientTrusted( X509Certificate [] chain, String authType) 74 throws CertificateException 75 { 76 } 79 80 83 public void 84 checkServerTrusted( X509Certificate [] chain, String authType) 85 throws CertificateException 86 { 87 } 90 91 94 public X509Certificate [] 95 getAcceptedIssuers() 96 { 97 return( new X509Certificate [ 0 ] ); 98 } 99 100 public String 101 toString() 102 { 103 return( "TrustAnyTrustManager--trusts all certificates with no check whatsoever" ); 104 } 105 } | Popular Tags |