public String chooseClientAlias ( String keyType , Principal [ ] issuers ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "chooseClientAlias" , new Object [ ] { keyType , issuers } ) ; Map < String , Object > connectionInfo = JSSEHelper . getInstance ( ) . getOutboundConnectionInfo ( ) ; // if SSL client auth is disabled do not return a client alias if ( connectionInfo != null && Constants . ENDPOINT_IIOP . equals ( connectionInfo . get ( Constants . CONNECTION_INFO_ENDPOINT_NAME ) ) && ! SSLConfigManager . getInstance ( ) . isClientAuthenticationEnabled ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias: null" ) ; return null ; } else if ( clientAlias != null && ! clientAlias . equals ( "" ) ) { String [ ] list = km . getClientAliases ( keyType , issuers ) ; if ( list != null ) { boolean found = false ; for ( int i = 0 ; i < list . length && ! found ; i ++ ) { if ( clientAlias . equalsIgnoreCase ( list [ i ] ) ) found = true ; } if ( found ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias" , new Object [ ] { clientAlias } ) ; // JCERACFKS and JCECCARACFKS support mixed case, if we see that type, // do not lowercase the alias if ( ks . getType ( ) != null && ( ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCERACFKS ) || ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCECCARACFKS ) || ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCEHYBRIDRACFKS ) ) ) { return clientAlias ; } return clientAlias . toLowerCase ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias (default)" , new Object [ ] { clientAlias } ) ; // error case, alias not found in the list. return clientAlias ; } else { String [ ] keyArray = new String [ ] { keyType } ; String alias = km . chooseClientAlias ( keyArray , issuers , null ) ; // JCERACFKS and JCECCARACFKS support mixed case, if we see that type, do // not lowercase the alias if ( ks . getType ( ) != null && ( ! ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCERACFKS ) && ! ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCECCARACFKS ) && ! ks . getType ( ) . equals ( Constants . KEYSTORE_TYPE_JCEHYBRIDRACFKS ) ) ) { if ( alias != null ) { alias = alias . toLowerCase ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "chooseClientAlias (from JSSE)" , new Object [ ] { alias } ) ; return alias ; } }
Choose a client alias .