use of org.infinispan.server.configuration.security.TrustStoreConfiguration in project infinispan by infinispan.
the class ServerConfigurationSerializer method writeServerIdentities.
private void writeServerIdentities(ConfigurationWriter writer, ServerIdentitiesConfiguration identities) {
SSLConfiguration ssl = identities.sslConfiguration();
List<KerberosSecurityFactoryConfiguration> kerberosList = identities.kerberosConfigurations();
if (ssl != null || !kerberosList.isEmpty()) {
writer.writeStartElement(Element.SERVER_IDENTITIES);
if (ssl != null) {
writer.writeStartElement(Element.SSL);
ssl.keyStore().write(writer);
TrustStoreConfiguration trustStore = ssl.trustStore();
if (trustStore != null) {
trustStore.write(writer);
}
ssl.engine().write(writer);
writer.writeEndElement();
}
if (!kerberosList.isEmpty()) {
for (KerberosSecurityFactoryConfiguration kerberos : kerberosList) {
kerberos.write(writer);
}
}
writer.writeEndElement();
}
}
use of org.infinispan.server.configuration.security.TrustStoreConfiguration in project infinispan by infinispan.
the class ServerConfigurationSerializer method writeSecurityRealms.
private void writeSecurityRealms(ConfigurationWriter writer, RealmsConfiguration realms) {
if (!realms.realms().isEmpty()) {
writer.writeStartArrayElement(Element.SECURITY_REALMS);
for (Map.Entry<String, RealmConfiguration> e : realms.realms().entrySet()) {
RealmConfiguration realm = e.getValue();
writer.writeStartElement(Element.SECURITY_REALM);
realm.attributes().write(writer);
writeServerIdentities(writer, realm.serverIdentitiesConfiguration());
for (RealmProvider provider : realm.realmProviders()) {
if (provider instanceof FileSystemRealmConfiguration) {
writeRealm(writer, (FileSystemRealmConfiguration) provider);
} else if (provider instanceof LdapRealmConfiguration) {
writeRealm(writer, (LdapRealmConfiguration) provider);
} else if (provider instanceof LocalRealmConfiguration) {
writeRealm(writer, (LocalRealmConfiguration) provider);
} else if (provider instanceof PropertiesRealmConfiguration) {
writeRealm(writer, (PropertiesRealmConfiguration) provider);
} else if (provider instanceof TokenRealmConfiguration) {
writeRealm(writer, (TokenRealmConfiguration) provider);
} else if (provider instanceof TrustStoreConfiguration) {
writeRealm(writer, (TrustStoreRealmConfiguration) provider);
}
}
// SECURITY_REALM
writer.writeEndElement();
}
// SECURITY_REALMS
writer.writeEndArrayElement();
}
}
Aggregations