1 23 package com.sun.enterprise.management; 24 25 import java.io.File ; 26 import java.io.IOException ; 27 28 import java.security.cert.Certificate ; 29 import java.security.cert.CertificateException ; 30 import java.security.KeyStoreException ; 31 import java.security.NoSuchAlgorithmException ; 32 import java.security.UnrecoverableKeyException ; 33 34 35 import com.sun.appserv.management.client.TrustStoreTrustManager; 36 37 38 public final class TestClientTrustStoreTrustManager 39 extends TrustStoreTrustManager 40 { 41 public 42 TestClientTrustStoreTrustManager( ) 43 { 44 this( new File ( "./TestClient-TrustStore" ), "changeme".toCharArray() ); 45 } 46 47 public 48 TestClientTrustStoreTrustManager( final File trustStore, final char[] password ) 49 { 50 super( trustStore, password ); 51 } 52 53 protected boolean 54 shouldAddToTrustStore( final Certificate c ) 55 { 56 return( true ); 58 } 59 60 protected void 61 addCertificateToTrustStore( 62 final String alias, 63 final Certificate c ) 64 throws IOException , 65 KeyStoreException , NoSuchAlgorithmException , CertificateException 66 { 67 super.addCertificateToTrustStore( alias, c ); 68 System.out.println( "added certificate to truststore: " + c ); 69 } 70 } | Popular Tags |