209 lines
6.7 KiB
Java
209 lines
6.7 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.log.Log
|
|
* javax.baja.security.crypto.BTlsEnum
|
|
* javax.baja.sys.BComponent
|
|
* javax.baja.sys.BValue
|
|
* javax.baja.sys.InvalidEnumException
|
|
* javax.baja.sys.Property
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
* javax.baja.xml.XElem
|
|
*/
|
|
package com.tridium.platform;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import javax.baja.log.Log;
|
|
import javax.baja.security.crypto.BTlsEnum;
|
|
import javax.baja.sys.BComponent;
|
|
import javax.baja.sys.BValue;
|
|
import javax.baja.sys.InvalidEnumException;
|
|
import javax.baja.sys.Property;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
import javax.baja.xml.XElem;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class BPlatformSSLSettings
|
|
extends BComponent {
|
|
public static final int DEFAULT_SSL_PORT = 5011;
|
|
public static final Property sslLicensed = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null);
|
|
public static final Property sslEnabled = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null);
|
|
public static final Property sslOnly = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null);
|
|
public static final Property sslPort = BPlatformSSLSettings.newProperty((int)3, (int)5011, null);
|
|
public static final Property keyAlias = BPlatformSSLSettings.newProperty((int)3, (String)"tridium", null);
|
|
public static final Property sslAlgType = BPlatformSSLSettings.newProperty((int)3, (BValue)BTlsEnum.DEFAULT, null);
|
|
public static final Property fipsMode = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null);
|
|
public static final Property supportsTlsMinProtocol = BPlatformSSLSettings.newProperty((int)3, (boolean)false, null);
|
|
public static final Type TYPE;
|
|
public static Log log;
|
|
private List aliases;
|
|
static /* synthetic */ Class class$com$tridium$platform$BPlatformSSLSettings;
|
|
|
|
public boolean getSslLicensed() {
|
|
return this.getBoolean(sslLicensed);
|
|
}
|
|
|
|
public void setSslLicensed(boolean bl) {
|
|
this.setBoolean(sslLicensed, bl, null);
|
|
}
|
|
|
|
public boolean getSslEnabled() {
|
|
return this.getBoolean(sslEnabled);
|
|
}
|
|
|
|
public void setSslEnabled(boolean bl) {
|
|
this.setBoolean(sslEnabled, bl, null);
|
|
}
|
|
|
|
public boolean getSslOnly() {
|
|
return this.getBoolean(sslOnly);
|
|
}
|
|
|
|
public void setSslOnly(boolean bl) {
|
|
this.setBoolean(sslOnly, bl, null);
|
|
}
|
|
|
|
public int getSslPort() {
|
|
return this.getInt(sslPort);
|
|
}
|
|
|
|
public void setSslPort(int n) {
|
|
this.setInt(sslPort, n, null);
|
|
}
|
|
|
|
public String getKeyAlias() {
|
|
return this.getString(keyAlias);
|
|
}
|
|
|
|
public void setKeyAlias(String string) {
|
|
this.setString(keyAlias, string, null);
|
|
}
|
|
|
|
public BTlsEnum getSslAlgType() {
|
|
return (BTlsEnum)this.get(sslAlgType);
|
|
}
|
|
|
|
public void setSslAlgType(BTlsEnum bTlsEnum) {
|
|
this.set(sslAlgType, (BValue)bTlsEnum, null);
|
|
}
|
|
|
|
public boolean getFipsMode() {
|
|
return this.getBoolean(fipsMode);
|
|
}
|
|
|
|
public void setFipsMode(boolean bl) {
|
|
this.setBoolean(fipsMode, bl, null);
|
|
}
|
|
|
|
public boolean getSupportsTlsMinProtocol() {
|
|
return this.getBoolean(supportsTlsMinProtocol);
|
|
}
|
|
|
|
public void setSupportsTlsMinProtocol(boolean bl) {
|
|
this.setBoolean(supportsTlsMinProtocol, bl, null);
|
|
}
|
|
|
|
public Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public void updateFromXml(XElem xElem) {
|
|
BTlsEnum bTlsEnum;
|
|
this.setSslLicensed(this.getB(xElem, "sslLicensed", "true"));
|
|
this.setSslEnabled(this.getB(xElem, "sslEnabled"));
|
|
this.setSslOnly(this.getB(xElem, "sslOnly"));
|
|
this.setSslPort(xElem.geti("sslPort"));
|
|
this.setKeyAlias(xElem.get("keyAlias"));
|
|
this.setFipsMode(this.getB(xElem, "fipsMode", "false"));
|
|
this.setSupportsTlsMinProtocol(this.getB(xElem, "supportsTlsMinProtocol", "false"));
|
|
String string = xElem.get("sslAlgType");
|
|
if (string != null) {
|
|
string = string.toLowerCase();
|
|
}
|
|
try {
|
|
bTlsEnum = BTlsEnum.make((String)string);
|
|
}
|
|
catch (InvalidEnumException invalidEnumException) {
|
|
log.trace("Unrecognized platform TLS protocol: " + string + ", defaulting to " + BTlsEnum.DEFAULT.getTag());
|
|
bTlsEnum = BTlsEnum.DEFAULT;
|
|
}
|
|
this.setSslAlgType(bTlsEnum);
|
|
}
|
|
|
|
public List getAliases() {
|
|
return this.aliases;
|
|
}
|
|
|
|
public void setAliases(List list) {
|
|
this.aliases = list;
|
|
}
|
|
|
|
private final boolean getB(XElem xElem, String string) {
|
|
return this.getB(xElem, string, "false");
|
|
}
|
|
|
|
private final boolean getB(XElem xElem, String string, String string2) {
|
|
return Boolean.valueOf(xElem.get(string, string2));
|
|
}
|
|
|
|
public void loadAliases(XElem xElem) {
|
|
XElem[] xElemArray = xElem.elems("key");
|
|
ArrayList<String> arrayList = new ArrayList<String>(xElemArray.length);
|
|
int n = 0;
|
|
while (n < xElemArray.length) {
|
|
arrayList.add(xElemArray[n].get("alias"));
|
|
++n;
|
|
}
|
|
this.setAliases(arrayList);
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.aliases = null;
|
|
}
|
|
|
|
public BPlatformSSLSettings() {
|
|
this.this();
|
|
}
|
|
|
|
public BPlatformSSLSettings(BPlatformSSLSettings bPlatformSSLSettings) {
|
|
this.this();
|
|
this.setSslEnabled(bPlatformSSLSettings.getSslEnabled());
|
|
this.setSslLicensed(bPlatformSSLSettings.getSslLicensed());
|
|
this.setSslOnly(bPlatformSSLSettings.getSslOnly());
|
|
this.setSslPort(bPlatformSSLSettings.getSslPort());
|
|
this.setKeyAlias(bPlatformSSLSettings.getKeyAlias());
|
|
this.setSslAlgType(bPlatformSSLSettings.getSslAlgType());
|
|
this.setFipsMode(bPlatformSSLSettings.getFipsMode());
|
|
this.setSupportsTlsMinProtocol(bPlatformSSLSettings.getSupportsTlsMinProtocol());
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$platform$BPlatformSSLSettings;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$BPlatformSSLSettings = BPlatformSSLSettings.class("[Lcom.tridium.platform.BPlatformSSLSettings;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
log = Log.getLog((String)"platform");
|
|
}
|
|
}
|
|
|