link start!

This commit is contained in:
cherubin
2026-03-17 13:31:18 -07:00
commit 08abe87cfb
5910 changed files with 386288 additions and 0 deletions
@@ -0,0 +1,911 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.crypto.core.cert.CertUtils
* com.tridium.crypto.core.cert.NHostExemption
* com.tridium.crypto.core.cert.NKey
* com.tridium.crypto.core.cert.NPKCS10CertificationRequest
* com.tridium.crypto.core.cert.NX509Certificate
* com.tridium.crypto.core.cert.NX509CertificateEntry
* com.tridium.crypto.core.io.CoreCryptoManager
* com.tridium.crypto.core.io.ICoreCryptoManager
* com.tridium.crypto.core.io.ICoreExemptionStore
* com.tridium.crypto.core.io.ICoreKeyStore
* com.tridium.crypto.core.provider.IProvider
* com.tridium.crypto.core.provider.NProvider
* com.tridium.fox.session.FoxRequest
* com.tridium.fox.session.FoxResponse
* com.tridium.fox.session.InvalidCommandException
* com.tridium.fox.sys.BFoxChannel
* com.tridium.fox.sys.BFoxSession
* com.tridium.nre.security.ISecurityInfoProvider
* com.tridium.nre.util.LegacyStorageUtil
* com.tridium.sys.Nre
* javax.baja.file.BFileSystem
* javax.baja.file.FilePath
* javax.baja.log.Log
* javax.baja.naming.BISession
* javax.baja.naming.BLocalHost
* javax.baja.naming.BOrd
* javax.baja.naming.OrdQuery
* javax.baja.nre.util.Array
* javax.baja.sys.BComponent
* javax.baja.sys.Sys
* javax.baja.sys.Type
* org.bouncycastle.jce.PrincipalUtil
* org.bouncycastle.jce.X509Principal
*/
package com.tridium.platcrypto.fox;
import com.tridium.crypto.core.cert.CertUtils;
import com.tridium.crypto.core.cert.NHostExemption;
import com.tridium.crypto.core.cert.NKey;
import com.tridium.crypto.core.cert.NPKCS10CertificationRequest;
import com.tridium.crypto.core.cert.NX509Certificate;
import com.tridium.crypto.core.cert.NX509CertificateEntry;
import com.tridium.crypto.core.io.CoreCryptoManager;
import com.tridium.crypto.core.io.ICoreCryptoManager;
import com.tridium.crypto.core.io.ICoreExemptionStore;
import com.tridium.crypto.core.io.ICoreKeyStore;
import com.tridium.crypto.core.provider.IProvider;
import com.tridium.crypto.core.provider.NProvider;
import com.tridium.fox.session.FoxRequest;
import com.tridium.fox.session.FoxResponse;
import com.tridium.fox.session.InvalidCommandException;
import com.tridium.fox.sys.BFoxChannel;
import com.tridium.fox.sys.BFoxSession;
import com.tridium.nre.security.ISecurityInfoProvider;
import com.tridium.nre.util.LegacyStorageUtil;
import com.tridium.platcrypto.fox.ChannelCryptoManager;
import com.tridium.sys.Nre;
import java.io.File;
import java.io.IOException;
import java.security.Key;
import java.security.UnrecoverableKeyException;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.Vector;
import javax.baja.file.BFileSystem;
import javax.baja.file.FilePath;
import javax.baja.log.Log;
import javax.baja.naming.BISession;
import javax.baja.naming.BLocalHost;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdQuery;
import javax.baja.nre.util.Array;
import javax.baja.sys.BComponent;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import org.bouncycastle.jce.PrincipalUtil;
import org.bouncycastle.jce.X509Principal;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BCryptoChannel
extends BFoxChannel {
public static final Type TYPE;
private static Log log;
private ICoreCryptoManager service;
private boolean validChannel;
static /* synthetic */ Class class$com$tridium$platcrypto$fox$BCryptoChannel;
static /* synthetic */ Class class$com$tridium$crypto$core$cert$NX509CertificateEntry;
static /* synthetic */ Class class$com$tridium$crypto$core$cert$NHostExemption;
public Type getType() {
return TYPE;
}
public void sessionOpened() throws Exception {
if (this.isRunning()) {
Log.getLog((String)"crypto").trace("pairing CertManagerService with CryptoChannel");
BISession bISession = this.getSession();
if (bISession instanceof BLocalHost) {
this.service = CoreCryptoManager.get((ISecurityInfoProvider)Nre.getSecurityInfoProvider());
} else if (bISession instanceof BFoxSession) {
this.service = new ChannelCryptoManager((BComponent)this);
}
}
}
public void sessionClosed(Throwable throwable) throws Exception {
Log.getLog((String)"crypto").trace("unpairing CertManagerService with CryptoChannel");
}
public FoxResponse process(FoxRequest foxRequest) throws Throwable {
String string = foxRequest.command;
if (string == "keystore.serverAliases") {
return this.keyStoreServerAliases(foxRequest);
}
if (string == "keystore.aliases") {
return this.keyStoreAliases(foxRequest);
}
if (string == "keystore.containsAlias") {
return this.keyStoreContainsAlias(foxRequest);
}
if (string == "keystore.deleteEntry") {
return this.keyStoreDeleteEntry(foxRequest);
}
if (string == "keystore.getCertificate") {
return this.keyStoreGetCertificate(foxRequest);
}
if (string == "keystore.getCertificateAlias") {
return this.keyStoreGetCertificateAlias(foxRequest);
}
if (string == "keystore.getCertificateChain") {
return this.keyStoreGetCertificateChain(foxRequest);
}
if (string == "keystore.getCreationDate") {
return this.keyStoreGetCreationDate(foxRequest);
}
if (string == "keystore.getKey") {
return this.keyStoreGetKey(foxRequest);
}
if (string == "keystore.isCertificateEntry") {
return this.keyStoreIsCertificateEntry(foxRequest);
}
if (string == "keystore.isKeyEntry") {
return this.keyStoreIsKeyEntry(foxRequest);
}
if (string == "keystore.setCertificateEntry") {
return this.keyStoreSetCertificateEntry(foxRequest);
}
if (string == "keystore.setKeyEntry0") {
return this.keyStoreSetKeyEntry0(foxRequest);
}
if (string == "keystore.setKeyEntry1") {
return this.keyStoreSetKeyEntry1(foxRequest);
}
if (string == "keystore.size") {
return this.keyStoreSize(foxRequest);
}
if (string == "keystore.save") {
return this.keyStoreSave(foxRequest);
}
if (string == "keystore.getCertificates") {
return this.keyStoreGetCertificates(foxRequest);
}
if (string == "keystore.deleteEntries") {
return this.keyStoreDeleteEntries(foxRequest);
}
if (string == "keystore.findCertificate") {
return this.keyStoreFindCertificate(foxRequest);
}
if (string == "keystore.generateSelfSignedCert") {
return this.keyStoreGenerateSelfSignedCert(foxRequest);
}
if (string == "keystore.getCertGenerationStatus") {
return this.keyGetCertGenerationStatus(foxRequest);
}
if (string == "keystore.generateCSR") {
return this.keyStoreGenerateCSR(foxRequest);
}
if (string == "provider.Providers") {
return this.providerProviders(foxRequest);
}
if (string == "provider.getProvider") {
return this.providerGetProvider(foxRequest);
}
if (string == "exemption.exemptions") {
return this.exemptionExemptions(foxRequest);
}
if (string == "exemption.setExemption") {
return this.exemptionSetExemption(foxRequest);
}
if (string == "exemption.deleteExemption") {
return this.exemptionDeleteExemption(foxRequest);
}
if (string == "exemption.getExemption") {
return this.exemptionGetExemption(foxRequest);
}
if (string == "exemption.save") {
return this.exemptionSave(foxRequest);
}
throw new InvalidCommandException(string);
}
public Enumeration keyStoreServerAliases() throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.serverAliases");
foxRequest.add("useTrustStore", false);
FoxResponse foxResponse = this.sendSync(foxRequest);
String[] stringArray = foxResponse.listStrings("alias");
List<String> list = Arrays.asList(stringArray);
Enumeration<String> enumeration = Collections.enumeration(list);
return enumeration;
}
private final FoxResponse keyStoreServerAliases(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
Enumeration enumeration = iCoreKeyStore.aliases();
while (enumeration.hasMoreElements()) {
String string = (String)enumeration.nextElement();
if (!CertUtils.isValidServerCert((String)string, (ICoreKeyStore)iCoreKeyStore)) continue;
foxResponse.add("alias", string);
}
return foxResponse;
}
public Enumeration keyStoreAliases(boolean bl) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.aliases");
foxRequest.add("useTrustStore", bl);
FoxResponse foxResponse = this.sendSync(foxRequest);
String[] stringArray = foxResponse.listStrings("alias");
List<String> list = Arrays.asList(stringArray);
Enumeration<String> enumeration = Collections.enumeration(list);
return enumeration;
}
private final FoxResponse keyStoreAliases(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
Enumeration enumeration = iCoreKeyStore.aliases();
while (enumeration.hasMoreElements()) {
String string = (String)enumeration.nextElement();
foxResponse.add("alias", string);
}
return foxResponse;
}
public boolean keyStoreContainsAlias(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.containsAlias");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getBoolean("containsAlias");
}
private final FoxResponse keyStoreContainsAlias(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
foxResponse.add("containsAlias", iCoreKeyStore.containsAlias(foxRequest.getString("alias")));
return foxResponse;
}
public void keyStoreDeleteEntry(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.deleteEntry");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
this.sendSync(foxRequest);
}
private final FoxResponse keyStoreDeleteEntry(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
iCoreKeyStore.deleteEntry(foxRequest.getString("alias"));
return foxResponse;
}
public X509Certificate keyStoreGetCertificate(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.getCertificate");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
String string2 = foxResponse.getString("certificate", null);
if (string2 != null) {
X509Certificate x509Certificate = NX509Certificate.decodeFromString((String)string2);
return x509Certificate;
}
return null;
}
private final FoxResponse keyStoreGetCertificate(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
X509Certificate x509Certificate = iCoreKeyStore.getCertificate(foxRequest.getString("alias"));
if (x509Certificate != null) {
foxResponse.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate));
}
return foxResponse;
}
public String keyStoreGetCertificateAlias(boolean bl, X509Certificate x509Certificate) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.getCertificateAlias");
foxRequest.add("useTrustStore", bl);
foxRequest.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate));
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getString("alias", null);
}
private final FoxResponse keyStoreGetCertificateAlias(FoxRequest foxRequest) throws Exception {
X509Certificate x509Certificate;
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
String string = iCoreKeyStore.getCertificateAlias(x509Certificate = NX509Certificate.decodeFromString((String)foxRequest.getString("certificate")));
if (string != null) {
foxResponse.add("alias", string);
}
return foxResponse;
}
public X509Certificate[] keyStoreGetCertificateChain(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.getCertificateChain");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
String[] stringArray = foxResponse.listStrings("certificateChain");
X509Certificate[] x509CertificateArray = null;
if (stringArray.length > 0) {
x509CertificateArray = new X509Certificate[stringArray.length];
int n = 0;
while (n < stringArray.length) {
x509CertificateArray[n] = NX509Certificate.decodeFromString((String)stringArray[n]);
++n;
}
}
return x509CertificateArray;
}
private final FoxResponse keyStoreGetCertificateChain(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
X509Certificate[] x509CertificateArray = iCoreKeyStore.getCertificateChain(foxRequest.getString("alias"));
if (x509CertificateArray != null) {
int n = 0;
while (n < x509CertificateArray.length) {
foxResponse.add("certificateChain", NX509Certificate.encodeToString((X509Certificate)x509CertificateArray[n]));
++n;
}
}
return foxResponse;
}
public Date keyStoreGetCreationDate(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.getCreationDate");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
Date date = new Date(foxResponse.getTime("creationDate"));
return date;
}
private final FoxResponse keyStoreGetCreationDate(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
Date date = iCoreKeyStore.getCreationDate(foxRequest.getString("alias"));
foxResponse.add("creationDate", date.getTime());
return foxResponse;
}
public Key keyStoreGetKey(boolean bl, String string, char[] cArray) throws Exception {
Object object;
Object object2;
FoxRequest foxRequest = this.makeRequest("keystore.getKey");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
if (cArray != null) {
object2 = new String(cArray);
object = LegacyStorageUtil.encode((String)object2);
foxRequest.add("password", (String)object);
}
object2 = this.sendSync(foxRequest);
object = null;
boolean bl2 = object2.getBoolean("success", false);
if (bl2) {
String string2 = object2.getString("key", null);
if (string2 != null) {
object = NKey.decodeFromString((String)string2);
}
return object;
}
throw new UnrecoverableKeyException("unable to recover key");
}
private final FoxResponse keyStoreGetKey(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
try {
Key key;
char[] cArray = null;
if (foxRequest.getString("password", null) != null) {
cArray = LegacyStorageUtil.decode((String)foxRequest.getString("password")).toCharArray();
}
if ((key = iCoreKeyStore.getKey(foxRequest.getString("alias"), cArray)) != null) {
foxResponse.add("success", true);
foxResponse.add("key", NKey.encodeToString((Key)key));
} else {
foxResponse.add("success", false);
}
return foxResponse;
}
catch (UnrecoverableKeyException unrecoverableKeyException) {
foxResponse.add("success", false);
return foxResponse;
}
}
public boolean keyStoreIsCertificateEntry(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.isCertificateEntry");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getBoolean("isCertificateEntry");
}
private final FoxResponse keyStoreIsCertificateEntry(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
foxResponse.add("isCertificateEntry", iCoreKeyStore.isCertificateEntry(foxRequest.getString("alias")));
return foxResponse;
}
public boolean keyStoreIsKeyEntry(boolean bl, String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.isKeyEntry");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getBoolean("isKeyEntry");
}
private final FoxResponse keyStoreIsKeyEntry(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
foxResponse.add("isKeyEntry", iCoreKeyStore.isKeyEntry(foxRequest.getString("alias")));
return foxResponse;
}
public void keyStoreSetCertificateEntry(boolean bl, String string, X509Certificate x509Certificate) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.setCertificateEntry");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
foxRequest.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate));
this.sendSync(foxRequest);
}
private final FoxResponse keyStoreSetCertificateEntry(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
X509Certificate x509Certificate = NX509Certificate.decodeFromString((String)foxRequest.getString("certificate"));
iCoreKeyStore.setCertificateEntry(foxRequest.getString("alias"), x509Certificate);
return foxResponse;
}
public void keyStoreSetKeyEntry0(boolean bl, String string, byte[] byArray, X509Certificate[] x509CertificateArray) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.setKeyEntry0");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
foxRequest.add("key", byArray);
if (x509CertificateArray != null) {
int n = 0;
while (n < x509CertificateArray.length) {
foxRequest.add("chain", NX509Certificate.encodeToString((X509Certificate)x509CertificateArray[n]));
++n;
}
}
this.sendSync(foxRequest);
}
private final FoxResponse keyStoreSetKeyEntry0(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
byte[] byArray = foxRequest.getBlob("key");
X509Certificate[] x509CertificateArray = null;
String[] stringArray = null;
try {
stringArray = foxRequest.listStrings("chain");
x509CertificateArray = new X509Certificate[stringArray.length];
int n = 0;
while (n < stringArray.length) {
x509CertificateArray[n] = NX509Certificate.decodeFromString((String)stringArray[n]);
++n;
}
}
catch (IOException iOException) {}
iCoreKeyStore.setKeyEntry(foxRequest.getString("alias"), byArray, x509CertificateArray);
return foxResponse;
}
public void keyStoreSetKeyEntry1(boolean bl, String string, Key key, char[] cArray, X509Certificate[] x509CertificateArray) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.setKeyEntry1");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
foxRequest.add("key", NKey.encodeToString((Key)key));
if (cArray != null) {
String string2 = new String(cArray);
String string3 = LegacyStorageUtil.encode((String)string2);
foxRequest.add("password", string3);
}
if (x509CertificateArray != null) {
int n = 0;
while (n < x509CertificateArray.length) {
foxRequest.add("chain", NX509Certificate.encodeToString((X509Certificate)x509CertificateArray[n]));
++n;
}
}
this.sendSync(foxRequest);
}
private final FoxResponse keyStoreSetKeyEntry1(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
Key key = NKey.decodeFromString((String)foxRequest.getString("key"));
char[] cArray = null;
if (foxRequest.getString("password", null) != null) {
cArray = LegacyStorageUtil.decode((String)foxRequest.getString("password")).toCharArray();
}
X509Certificate[] x509CertificateArray = null;
String[] stringArray = null;
try {
stringArray = foxRequest.listStrings("chain");
x509CertificateArray = new X509Certificate[stringArray.length];
int n = 0;
while (n < stringArray.length) {
x509CertificateArray[n] = NX509Certificate.decodeFromString((String)stringArray[n]);
++n;
}
}
catch (IOException iOException) {}
iCoreKeyStore.setKeyEntry(foxRequest.getString("alias"), key, cArray, x509CertificateArray);
return foxResponse;
}
public int keyStoreSize(boolean bl) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.size");
foxRequest.add("useTrustStore", bl);
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getInt("size");
}
private final FoxResponse keyStoreSize(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
foxResponse.add("size", iCoreKeyStore.size());
return foxResponse;
}
public void keyStoreSave(boolean bl) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.save");
foxRequest.add("useTrustStore", bl);
this.sendSync(foxRequest);
}
private final FoxResponse keyStoreSave(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
iCoreKeyStore.save();
return foxResponse;
}
public Enumeration keyStoreGetCertificates(boolean bl) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.getCertificates");
foxRequest.add("useTrustStore", bl);
FoxResponse foxResponse = this.sendSync(foxRequest);
String[] stringArray = foxResponse.listStrings("cert");
Class clazz = class$com$tridium$crypto$core$cert$NX509CertificateEntry;
if (clazz == null) {
clazz = class$com$tridium$crypto$core$cert$NX509CertificateEntry = BCryptoChannel.class("[Lcom.tridium.crypto.core.cert.NX509CertificateEntry;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < stringArray.length) {
NX509CertificateEntry nX509CertificateEntry = NX509CertificateEntry.decodeFromString((String)stringArray[n]);
array.add((Object)nX509CertificateEntry);
++n;
}
Enumeration enumeration = Collections.enumeration(array.list());
return enumeration;
}
private final FoxResponse keyStoreGetCertificates(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
Enumeration enumeration = iCoreKeyStore.getCertificates();
while (enumeration.hasMoreElements()) {
NX509CertificateEntry nX509CertificateEntry = (NX509CertificateEntry)enumeration.nextElement();
foxResponse.add("cert", nX509CertificateEntry.encodeToString());
}
return foxResponse;
}
public String keyStoreFindCertificate(boolean bl, X509Certificate x509Certificate) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.findCertificate");
foxRequest.add("useTrustStore", bl);
foxRequest.add("certificate", NX509Certificate.encodeToString((X509Certificate)x509Certificate));
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getString("alias", null);
}
private final FoxResponse keyStoreFindCertificate(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
X509Certificate x509Certificate = NX509Certificate.decodeFromString((String)foxRequest.getString("certificate"));
X509Principal x509Principal = PrincipalUtil.getSubjectX509Principal((X509Certificate)x509Certificate);
Enumeration enumeration = iCoreKeyStore.aliases();
while (enumeration.hasMoreElements()) {
String string = (String)enumeration.nextElement();
X509Certificate x509Certificate2 = iCoreKeyStore.getCertificate(string);
if (!x509Certificate2.getType().equals("X.509")) continue;
X509Certificate x509Certificate3 = x509Certificate2;
X509Principal x509Principal2 = PrincipalUtil.getSubjectX509Principal((X509Certificate)x509Certificate3);
if (!x509Principal.equals((Object)x509Principal2)) break;
foxResponse.add("alias", string);
break;
}
return foxResponse;
}
public void keyStoreDeleteEntries(boolean bl, String[] stringArray) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.deleteEntries");
foxRequest.add("useTrustStore", bl);
int n = 0;
while (n < stringArray.length) {
foxRequest.add("alias", stringArray[n]);
++n;
}
this.sendSync(foxRequest);
}
private final FoxResponse keyStoreDeleteEntries(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
String[] stringArray = foxRequest.listStrings("alias");
int n = 0;
while (n < stringArray.length) {
log.trace("deleting entry " + stringArray[n]);
iCoreKeyStore.deleteEntry(stringArray[n]);
++n;
}
return foxResponse;
}
public int keyStoreGenerateSelfSignedCert(boolean bl, String string, String string2, Date date, Date date2, int n, int n2, String string3, String string4) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.generateSelfSignedCert");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
foxRequest.add("dn", string2);
foxRequest.add("notBefore", date.getTime());
foxRequest.add("notAfter", date2.getTime());
foxRequest.add("keySize", n);
foxRequest.add("keyUsage", n2);
foxRequest.add("email", string3);
foxRequest.add("password", string4);
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getInt("requestId", -1);
}
private final FoxResponse keyStoreGenerateSelfSignedCert(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
String string = foxRequest.getString("alias");
String string2 = foxRequest.getString("dn");
Date date = new Date(foxRequest.getTime("notBefore"));
Date date2 = new Date(foxRequest.getTime("notAfter"));
int n = foxRequest.getInt("keySize");
int n2 = foxRequest.getInt("keyUsage");
String string3 = foxRequest.getString("email", null);
String string4 = foxRequest.getString("password", null);
int n3 = iCoreKeyStore.generateSelfSignedCert(string, string2, date, date2, n, n2, string3, string4);
foxResponse.add("requestId", n3);
return foxResponse;
}
public int keyGetCertGenerationStatus(boolean bl, int n) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.getCertGenerationStatus");
foxRequest.add("useTrustStore", bl);
foxRequest.add("requestId", n);
FoxResponse foxResponse = this.sendSync(foxRequest);
return foxResponse.getInt("status", -1);
}
private final FoxResponse keyGetCertGenerationStatus(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
int n = foxRequest.getInt("requestId", -1);
int n2 = iCoreKeyStore.getCertGenerationStatus(n);
foxResponse.add("requestId", n);
foxResponse.add("status", n2);
return foxResponse;
}
public NPKCS10CertificationRequest keyStoreGenerateCSR(boolean bl, String string, String string2) throws Exception {
FoxRequest foxRequest = this.makeRequest("keystore.generateCSR");
foxRequest.add("useTrustStore", bl);
foxRequest.add("alias", string);
if (string2 != null) {
foxRequest.add("passwd", string2);
}
FoxResponse foxResponse = this.sendSync(foxRequest);
NPKCS10CertificationRequest nPKCS10CertificationRequest = NPKCS10CertificationRequest.make((String)foxResponse.getString("csr"));
return nPKCS10CertificationRequest;
}
private final FoxResponse keyStoreGenerateCSR(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreKeyStore iCoreKeyStore = this.getCorrectKeyStore(foxRequest);
String string = foxRequest.getString("alias");
String string2 = foxRequest.getString("passwd", null);
NPKCS10CertificationRequest nPKCS10CertificationRequest = iCoreKeyStore.generateCSR(string, string2);
foxResponse.add("csr", nPKCS10CertificationRequest.encodeToString());
return foxResponse;
}
public Enumeration providerProviders() throws Exception {
FoxRequest foxRequest = this.makeRequest("provider.Providers");
FoxResponse foxResponse = this.sendSync(foxRequest);
Vector<NProvider> vector = new Vector<NProvider>();
String[] stringArray = foxResponse.listStrings("provider");
int n = 0;
while (n < stringArray.length) {
vector.add(NProvider.decodeFromString((String)stringArray[n]));
++n;
}
return vector.elements();
}
private final FoxResponse providerProviders(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
NProvider[] nProviderArray = NProvider.getProviders();
int n = 0;
while (n < nProviderArray.length) {
foxResponse.add("provider", nProviderArray[n].encodeToString());
++n;
}
return foxResponse;
}
public IProvider providerGetProvider(String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("provider.getProvider");
foxRequest.add("name", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
return NProvider.decodeFromString((String)foxResponse.getString("provider"));
}
private final FoxResponse providerGetProvider(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
NProvider[] nProviderArray = NProvider.getProviders();
int n = 0;
while (n < nProviderArray.length) {
foxResponse.add("provider", nProviderArray[n].encodeToString());
++n;
}
return foxResponse;
}
public Enumeration exemptionExemptions() throws Exception {
FoxRequest foxRequest = this.makeRequest("exemption.exemptions");
FoxResponse foxResponse = this.sendSync(foxRequest);
String[] stringArray = foxResponse.listStrings("exemption");
Class clazz = class$com$tridium$crypto$core$cert$NHostExemption;
if (clazz == null) {
clazz = class$com$tridium$crypto$core$cert$NHostExemption = BCryptoChannel.class("[Lcom.tridium.crypto.core.cert.NHostExemption;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < stringArray.length) {
array.push((Object)NHostExemption.decodeFromString((String)stringArray[n]));
++n;
}
Enumeration enumeration = Collections.enumeration(array.list());
return enumeration;
}
private final FoxResponse exemptionExemptions(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore();
Enumeration enumeration = iCoreExemptionStore.exemptions();
while (enumeration.hasMoreElements()) {
NHostExemption nHostExemption = (NHostExemption)enumeration.nextElement();
foxResponse.add("exemption", nHostExemption.encodeToString());
}
return foxResponse;
}
public void exemptionSetExemption(NHostExemption nHostExemption) throws Exception {
FoxRequest foxRequest = this.makeRequest("exemption.setExemption");
foxRequest.add("exemption", nHostExemption.encodeToString());
this.sendSync(foxRequest);
}
private final FoxResponse exemptionSetExemption(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore();
NHostExemption nHostExemption = NHostExemption.make((String)foxRequest.getString("exemption"));
iCoreExemptionStore.setExemption(nHostExemption);
return foxResponse;
}
public void exemptionDeleteExemption(String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("exemption.deleteExemption");
foxRequest.add("host", string);
this.sendSync(foxRequest);
}
private final FoxResponse exemptionDeleteExemption(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore();
String string = foxRequest.getString("host");
iCoreExemptionStore.deleteExemption(string);
return foxResponse;
}
public NHostExemption exemptionGetExemption(String string) throws Exception {
FoxRequest foxRequest = this.makeRequest("exemption.getExemption");
foxRequest.add("host", string);
FoxResponse foxResponse = this.sendSync(foxRequest);
String string2 = foxResponse.getString("exemption");
NHostExemption nHostExemption = NHostExemption.make((String)string2);
return nHostExemption;
}
private final FoxResponse exemptionGetExemption(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore();
String string = foxRequest.getString("host");
NHostExemption nHostExemption = iCoreExemptionStore.getExemption(string);
foxResponse.add("exemption", nHostExemption.encodeToString());
return foxResponse;
}
public void exemptionSave() throws Exception {
FoxRequest foxRequest = this.makeRequest("exemption.save");
this.sendSync(foxRequest);
}
private final FoxResponse exemptionSave(FoxRequest foxRequest) throws Exception {
FoxResponse foxResponse = new FoxResponse(foxRequest);
ICoreExemptionStore iCoreExemptionStore = this.service.getExemptionStore();
iCoreExemptionStore.save();
return foxResponse;
}
private final ICoreKeyStore getCorrectKeyStore(FoxRequest foxRequest) throws Exception {
boolean bl = foxRequest.getBoolean("useTrustStore");
if (bl) {
return this.service.getTrustStore();
}
return this.service.getKeyStore();
}
public File getBaseDir() {
try {
return new File(BCryptoChannel.getFilePath(BOrd.make((String)"file:!")));
}
catch (Exception exception) {
return Sys.getBajaHome();
}
}
private static final String getFilePath(BOrd bOrd) throws IOException {
OrdQuery[] ordQueryArray = bOrd.parse();
FilePath filePath = (FilePath)ordQueryArray[ordQueryArray.length - 1];
File file = BFileSystem.INSTANCE.pathToLocalFile(filePath);
return file.getPath();
}
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.validChannel = false;
}
public BCryptoChannel() {
super("crypto");
this.this();
}
static {
Class clazz = class$com$tridium$platcrypto$fox$BCryptoChannel;
if (clazz == null) {
clazz = class$com$tridium$platcrypto$fox$BCryptoChannel = BCryptoChannel.class("[Lcom.tridium.platcrypto.fox.BCryptoChannel;", false);
}
TYPE = Sys.loadType((Class)clazz);
log = Log.getLog((String)"crypto");
}
}
@@ -0,0 +1,64 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.fox.sys.BFoxSession
* javax.baja.naming.BLocalHost
* javax.baja.security.crypto.CertManagerFactory
* javax.baja.sys.BComponent
*/
package com.tridium.platcrypto.fox;
import com.tridium.fox.sys.BFoxSession;
import com.tridium.platcrypto.fox.BCryptoChannel;
import java.io.IOException;
import javax.baja.naming.BLocalHost;
import javax.baja.security.crypto.CertManagerFactory;
import javax.baja.sys.BComponent;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public abstract class ChannelBase {
protected BCryptoChannel channel;
private BComponent parent;
protected void checkChannel() throws IOException {
if (!CertManagerFactory.isCertManagerActive()) {
return;
}
BFoxSession bFoxSession = (BFoxSession)this.parent.getSession();
this.channel = (BCryptoChannel)bFoxSession.getConnection().getChannels().get("crypto", BCryptoChannel.TYPE);
if (this.channel == null) {
throw new IOException("crypto fox channel not found");
}
}
public boolean isSecure() {
boolean bl = false;
if (!CertManagerFactory.isCertManagerActive()) {
return false;
}
BFoxSession bFoxSession = (BFoxSession)this.parent.getSession();
this.channel = (BCryptoChannel)bFoxSession.getConnection().getChannels().get("crypto", BCryptoChannel.TYPE);
if (this.channel != null) {
if (bFoxSession.getUseFoxs()) {
bl = true;
} else if (bFoxSession.getHost() instanceof BLocalHost) {
bl = true;
}
}
return bl;
}
private final /* synthetic */ void this() {
this.channel = null;
this.parent = null;
}
public ChannelBase(BComponent bComponent) {
this.this();
this.parent = bComponent;
}
}
@@ -0,0 +1,49 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.crypto.core.io.ICoreCryptoManager
* com.tridium.crypto.core.io.ICoreExemptionStore
* com.tridium.crypto.core.io.ICoreKeyStore
* com.tridium.crypto.core.io.ICoreProviderInfo
* javax.baja.sys.BComponent
*/
package com.tridium.platcrypto.fox;
import com.tridium.crypto.core.io.ICoreCryptoManager;
import com.tridium.crypto.core.io.ICoreExemptionStore;
import com.tridium.crypto.core.io.ICoreKeyStore;
import com.tridium.crypto.core.io.ICoreProviderInfo;
import com.tridium.platcrypto.fox.ChannelBase;
import com.tridium.platcrypto.fox.ChannelExemptionStore;
import com.tridium.platcrypto.fox.ChannelKeyStore;
import com.tridium.platcrypto.fox.ChannelProviderInfo;
import javax.baja.sys.BComponent;
public class ChannelCryptoManager
extends ChannelBase
implements ICoreCryptoManager {
private BComponent parent;
public ICoreKeyStore getKeyStore() throws Exception {
return new ChannelKeyStore(this.parent, false);
}
public ICoreKeyStore getTrustStore() throws Exception {
return new ChannelKeyStore(this.parent, true);
}
public ICoreExemptionStore getExemptionStore() throws Exception {
return new ChannelExemptionStore(this.parent);
}
public ICoreProviderInfo getProviderInfo() throws Exception {
return new ChannelProviderInfo(this.parent);
}
public ChannelCryptoManager(BComponent bComponent) {
super(bComponent);
this.parent = bComponent;
}
}
@@ -0,0 +1,58 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.crypto.core.cert.NHostExemption
* com.tridium.crypto.core.io.ICoreExemptionStore
* javax.baja.sys.BComponent
*/
package com.tridium.platcrypto.fox;
import com.tridium.crypto.core.cert.NHostExemption;
import com.tridium.crypto.core.io.ICoreExemptionStore;
import com.tridium.platcrypto.fox.ChannelBase;
import java.util.Enumeration;
import javax.baja.sys.BComponent;
public class ChannelExemptionStore
extends ChannelBase
implements ICoreExemptionStore {
public Enumeration exemptions() throws Exception {
this.checkChannel();
return this.channel.exemptionExemptions();
}
public void setExemption(NHostExemption nHostExemption) throws Exception {
this.checkChannel();
this.channel.exemptionSetExemption(nHostExemption);
}
public void deleteExemption(String string) throws Exception {
this.checkChannel();
this.channel.exemptionDeleteExemption(string);
}
public NHostExemption getExemption(String string) throws Exception {
this.checkChannel();
return this.channel.exemptionGetExemption(string);
}
public long getLastModified() throws Exception {
this.checkChannel();
return 0L;
}
public void load() throws Exception {
this.checkChannel();
}
public void save() throws Exception {
this.checkChannel();
this.channel.exemptionSave();
}
public ChannelExemptionStore(BComponent bComponent) {
super(bComponent);
}
}
@@ -0,0 +1,174 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.crypto.core.cert.CertUtils
* com.tridium.crypto.core.cert.NPKCS10CertificationRequest
* com.tridium.crypto.core.io.ICoreKeyStore
* javax.baja.log.Log
* javax.baja.security.crypto.IKeyStore
* javax.baja.sys.BComponent
*/
package com.tridium.platcrypto.fox;
import com.tridium.crypto.core.cert.CertUtils;
import com.tridium.crypto.core.cert.NPKCS10CertificationRequest;
import com.tridium.crypto.core.io.ICoreKeyStore;
import com.tridium.platcrypto.fox.ChannelBase;
import java.security.Key;
import java.security.KeyStore;
import java.security.cert.X509Certificate;
import java.util.Date;
import java.util.Enumeration;
import javax.baja.log.Log;
import javax.baja.security.crypto.IKeyStore;
import javax.baja.sys.BComponent;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class ChannelKeyStore
extends ChannelBase
implements IKeyStore,
ICoreKeyStore {
protected static Log log = Log.getLog((String)"crypto");
private boolean isTrustStore;
public Enumeration aliases() throws Exception {
this.checkChannel();
return this.channel.keyStoreAliases(this.isTrustStore);
}
public boolean containsAlias(String string) throws Exception {
this.checkChannel();
return this.channel.keyStoreContainsAlias(this.isTrustStore, string);
}
public void deleteEntry(String string) throws Exception {
this.checkChannel();
this.channel.keyStoreDeleteEntry(this.isTrustStore, string);
}
public X509Certificate getCertificate(String string) throws Exception {
this.checkChannel();
return this.channel.keyStoreGetCertificate(this.isTrustStore, string);
}
public String getCertificateAlias(X509Certificate x509Certificate) throws Exception {
this.checkChannel();
return this.channel.keyStoreGetCertificateAlias(this.isTrustStore, x509Certificate);
}
public X509Certificate[] getCertificateChain(String string) throws Exception {
this.checkChannel();
return this.channel.keyStoreGetCertificateChain(this.isTrustStore, string);
}
public Date getCreationDate(String string) throws Exception {
this.checkChannel();
return this.channel.keyStoreGetCreationDate(this.isTrustStore, string);
}
public Key getKey(String string, char[] cArray) throws Exception {
this.checkChannel();
return this.channel.keyStoreGetKey(this.isTrustStore, string, cArray);
}
public boolean isCertificateEntry(String string) throws Exception {
this.checkChannel();
return this.channel.keyStoreIsCertificateEntry(this.isTrustStore, string);
}
public boolean isKeyEntry(String string) throws Exception {
this.checkChannel();
return this.channel.keyStoreIsKeyEntry(this.isTrustStore, string);
}
public void setCertificateEntry(String string, X509Certificate x509Certificate) throws Exception {
this.checkChannel();
this.channel.keyStoreSetCertificateEntry(this.isTrustStore, string, x509Certificate);
}
public void setKeyEntry(String string, byte[] byArray, X509Certificate[] x509CertificateArray) throws Exception {
this.checkChannel();
this.channel.keyStoreSetKeyEntry0(this.isTrustStore, string, byArray, x509CertificateArray);
}
public void setKeyEntry(String string, Key key, char[] cArray, X509Certificate[] x509CertificateArray) throws Exception {
this.checkChannel();
this.channel.keyStoreSetKeyEntry1(this.isTrustStore, string, key, cArray, x509CertificateArray);
}
public int size() throws Exception {
this.checkChannel();
return this.channel.keyStoreSize(this.isTrustStore);
}
public long getLastModified() throws Exception {
this.checkChannel();
return 0L;
}
public void load() throws Exception {
this.checkChannel();
}
public void save() throws Exception {
this.checkChannel();
this.channel.keyStoreSave(this.isTrustStore);
}
public Enumeration getCertificates() throws Exception {
this.checkChannel();
return this.channel.keyStoreGetCertificates(this.isTrustStore);
}
public String findCertificate(X509Certificate x509Certificate) throws Exception {
this.checkChannel();
return this.channel.keyStoreFindCertificate(this.isTrustStore, x509Certificate);
}
public void deleteEntries(String[] stringArray) throws Exception {
this.checkChannel();
this.channel.keyStoreDeleteEntries(this.isTrustStore, stringArray);
}
public KeyStore getKeyStore() throws Exception {
throw new UnsupportedOperationException("can't access raw keystore remotely");
}
public int generateSelfSignedCert(String string, String string2, String string3, String string4, String string5, String string6, String string7, Date date, Date date2, int n, int n2, String string8, String string9) throws Exception {
this.checkChannel();
String string10 = CertUtils.assembleDN((String)string2, (String)string3, (String)string4, (String)string5, (String)string6, (String)string7);
return this.channel.keyStoreGenerateSelfSignedCert(this.isTrustStore, string, string10, date, date2, n, n2, string8, string9);
}
public int generateSelfSignedCert(String string, String string2, Date date, Date date2, int n, int n2, String string3, String string4) throws Exception {
this.checkChannel();
return this.channel.keyStoreGenerateSelfSignedCert(this.isTrustStore, string, string2, date, date2, n, n2, string3, string4);
}
public int getCertGenerationStatus(int n) throws Exception {
return this.channel.keyGetCertGenerationStatus(this.isTrustStore, n);
}
public NPKCS10CertificationRequest generateCSR(String string, String string2) throws Exception {
this.checkChannel();
return this.channel.keyStoreGenerateCSR(this.isTrustStore, string, string2);
}
public boolean canGenerateCertificate() {
return true;
}
private final /* synthetic */ void this() {
this.isTrustStore = false;
}
public ChannelKeyStore(BComponent bComponent, boolean bl) {
super(bComponent);
this.this();
this.isTrustStore = bl;
}
}
@@ -0,0 +1,36 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.crypto.core.io.ICoreProviderInfo
* com.tridium.crypto.core.provider.IProvider
* javax.baja.sys.BComponent
*/
package com.tridium.platcrypto.fox;
import com.tridium.crypto.core.io.ICoreProviderInfo;
import com.tridium.crypto.core.provider.IProvider;
import com.tridium.platcrypto.core.IProviderInfo;
import com.tridium.platcrypto.fox.ChannelBase;
import java.util.Enumeration;
import javax.baja.sys.BComponent;
public class ChannelProviderInfo
extends ChannelBase
implements IProviderInfo,
ICoreProviderInfo {
public Enumeration providers() throws Exception {
this.checkChannel();
return this.channel.providerProviders();
}
public IProvider getProvider(String string) throws Exception {
this.checkChannel();
return this.channel.providerGetProvider(string);
}
public ChannelProviderInfo(BComponent bComponent) {
super(bComponent);
}
}
@@ -0,0 +1,102 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.fox.sys.BFoxsScheme$FoxQuery
* com.tridium.workbench.nav.BFoxCnxHandler
* com.tridium.workbench.ord.BFoxsSessionOrdFE
* com.tridium.workbench.ord.BHostOrdFE
* javax.baja.naming.BOrd
* javax.baja.naming.OrdQuery
* javax.baja.security.BICredentials
* javax.baja.security.BUsernameAndPassword
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
*/
package com.tridium.platcrypto.fox.ui;
import com.tridium.fox.sys.BFoxsScheme;
import com.tridium.workbench.nav.BFoxCnxHandler;
import com.tridium.workbench.ord.BFoxsSessionOrdFE;
import com.tridium.workbench.ord.BHostOrdFE;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdQuery;
import javax.baja.security.BICredentials;
import javax.baja.security.BUsernameAndPassword;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BFoxSCnxHandler
extends BFoxCnxHandler {
public static final Type TYPE;
private static final String KEY = "open.ssl.station";
static /* synthetic */ Class class$com$tridium$platcrypto$fox$ui$BFoxSCnxHandler;
public Type getType() {
return TYPE;
}
protected void saveHostAddress() throws Exception {
this.ordFE.setAutoSaveHistory(false);
BOrd bOrd = (BOrd)this.ordFE.saveValue();
OrdQuery[] ordQueryArray = bOrd.parse();
this.hostOrd = BOrd.make((OrdQuery)ordQueryArray[0]);
int n = this.defaultPort;
String[] stringArray = null;
int n2 = 1;
while (n2 < ordQueryArray.length) {
if (ordQueryArray[n2] instanceof BFoxsScheme.FoxQuery) {
BFoxsScheme.FoxQuery foxQuery = (BFoxsScheme.FoxQuery)ordQueryArray[n2];
n = foxQuery.getPort();
stringArray = foxQuery.getTunnelAuthorities();
break;
}
++n2;
}
this.port = n;
this.tunnelAuthorities = stringArray;
}
public boolean isSecure() {
return true;
}
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());
}
}
public BFoxSCnxHandler() {
super("foxs", 4911, (BHostOrdFE)new BFoxsSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), TYPE.getModule().getLexicon(), KEY);
}
public BFoxSCnxHandler(Lexicon lexicon, String string) {
super("foxs", 4911, (BHostOrdFE)new BFoxsSessionOrdFE(), (BICredentials)new BUsernameAndPassword(), lexicon, string);
}
public BFoxSCnxHandler(String string, int n, BHostOrdFE bHostOrdFE, BICredentials bICredentials, Lexicon lexicon, String string2) {
super(string, n, bHostOrdFE, bICredentials, lexicon, string2);
}
static {
Class clazz = class$com$tridium$platcrypto$fox$ui$BFoxSCnxHandler;
if (clazz == null) {
clazz = class$com$tridium$platcrypto$fox$ui$BFoxSCnxHandler = BFoxSCnxHandler.class("[Lcom.tridium.platcrypto.fox.ui.BFoxSCnxHandler;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,73 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.fox.sys.BFoxSession
* com.tridium.workbench.nav.BFoxSessionAgent
* javax.baja.naming.BHost
* javax.baja.naming.BISession
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.xml.XElem
*/
package com.tridium.platcrypto.fox.ui;
import com.tridium.fox.sys.BFoxSession;
import com.tridium.workbench.nav.BFoxSessionAgent;
import javax.baja.naming.BHost;
import javax.baja.naming.BISession;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.xml.XElem;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BFoxSslSessionAgent
extends BFoxSessionAgent {
public static final BFoxSslSessionAgent INSTANCE = new BFoxSslSessionAgent();
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platcrypto$fox$ui$BFoxSslSessionAgent;
public Type getType() {
return TYPE;
}
public void pickle(BISession bISession, XElem xElem) {
BFoxSession bFoxSession = (BFoxSession)bISession;
xElem.addAttr("port", "" + bFoxSession.getPort());
xElem.addAttr("useFoxs", "true");
if (bFoxSession.getStationName() != null) {
xElem.addAttr("stationName", bFoxSession.getStationName());
}
}
public BISession unpickle(BHost bHost, XElem xElem) {
int n = xElem.geti("port", 4911);
String string = xElem.get("stationName", null);
boolean bl = xElem.getb("useFoxs", true);
return BFoxSession.make((String)string, (BHost)bHost, (int)n, (boolean)true);
}
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());
}
}
static {
Class clazz = class$com$tridium$platcrypto$fox$ui$BFoxSslSessionAgent;
if (clazz == null) {
clazz = class$com$tridium$platcrypto$fox$ui$BFoxSslSessionAgent = BFoxSslSessionAgent.class("[Lcom.tridium.platcrypto.fox.ui.BFoxSslSessionAgent;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}