if (RegistryResources.SecurityManagement.PRIMARY_KEYSTORE_PHANTOM_RESOURCE
.equals(fullname)) {
continue;
}
Resource store = registry.get(ks[i]);
int lastIndex = fullname.lastIndexOf("/");
String name = fullname.substring(lastIndex + 1);
String type = store.getProperty(SecurityConstants.PROP_TYPE);
String provider = store.getProperty(SecurityConstants.PROP_PROVIDER);
KeyStoreData data = new KeyStoreData();
data.setKeyStoreName(name);
data.setKeyStoreType(type);
data.setProvider(provider);
String alias = store.getProperty(SecurityConstants.PROP_PRIVATE_KEY_ALIAS);
if (alias != null) {
data.setPrivateStore(true);
} else {
data.setPrivateStore(false);
}
// Dump the generated public key to the file system for sub tenants
if(!isSuperTenant){
Association[] associations = registry.getAssociations(
ks[i],SecurityConstants.ASSOCIATION_TENANT_KS_PUB_KEY);
if(associations != null && associations.length > 0){
Resource pubKeyResource = registry.get(associations[0].getDestinationPath());
String fileName = generatePubCertFileName(ks[i],
pubKeyResource.getProperty(
SecurityConstants.PROP_TENANT_PUB_KEY_FILE_NAME_APPENDER));
String pubKeyFilePath = KeyStoreMgtUtil.dumpCert(
MessageContext.getCurrentMessageContext().getConfigurationContext(),
(byte[])pubKeyResource.getContent(), fileName);
data.setPubKeyFilePath(pubKeyFilePath);
}
}
lst.add(data);