AxisService service = null;
Registry configRegistry = null;
Registry governRegistry = null;
String keyAlias = null;
String keyPassword = null;
KeyStoreAdmin admin = null;
KeyStoreData[] keystores = null;
String privateKeyAlias = null;
String keyStoreName = null;
String issuerName = null;
ServerConfiguration serverConfig = null;
configRegistry = STSServiceDataHolder.getInstance().getRegistryService()
.getConfigSystemRegistry();
governRegistry = STSServiceDataHolder.getInstance().getRegistryService()
.getGovernanceSystemRegistry();
if (configRegistry == null || config.getService(ServerConstants.STS_NAME) == null) {
if (log.isDebugEnabled()) {
log.debug("configRegistry not set or STS service is unavailable");
}
return;
}
serverConfig = ServerConfiguration.getInstance();
keyAlias = serverConfig.getFirstProperty("Security.KeyStore.KeyAlias");
keyPassword = serverConfig.getFirstProperty("Security.KeyStore.KeyPassword");
issuerName = serverConfig.getFirstProperty("HostName");
if (issuerName == null) {
// HostName not set :-( use wso2wsas-sts
issuerName = ServerConstants.STS_NAME;
}
admin = new KeyStoreAdmin(governRegistry);
keystores = admin.getKeyStores();
for (int i = 0; i < keystores.length; i++) {
if (KeyStoreUtil.isPrimaryStore(keystores[i].getKeyStoreName())) {
keyStoreName = keystores[i].getKeyStoreName();
privateKeyAlias = KeyStoreUtil.getPrivateKeyAlias(KeyStoreManager.getInstance(