176 lines
8.1 KiB
Java
176 lines
8.1 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.tridium.crypto.core.cert.NX509Certificate
|
|
* com.tridium.crypto.core.cert.NX509CertificateEntry
|
|
* com.tridium.crypto.core.io.CryptoSupport
|
|
* com.tridium.crypto.core.provider.IProvider
|
|
* com.tridium.crypto.core.provider.IProviderEntry
|
|
* com.tridium.crypto.core.provider.IProviderSection
|
|
* com.tridium.nre.security.SecurityInitializer
|
|
* javax.baja.security.crypto.CertManagerFactory
|
|
* javax.baja.security.crypto.IKeyStore
|
|
* javax.baja.spy.Spy
|
|
* javax.baja.spy.SpyDir
|
|
* javax.baja.spy.SpyWriter
|
|
*/
|
|
package com.tridium.platcrypto.spy;
|
|
|
|
import com.tridium.crypto.core.cert.NX509Certificate;
|
|
import com.tridium.crypto.core.cert.NX509CertificateEntry;
|
|
import com.tridium.crypto.core.io.CryptoSupport;
|
|
import com.tridium.crypto.core.provider.IProvider;
|
|
import com.tridium.crypto.core.provider.IProviderEntry;
|
|
import com.tridium.crypto.core.provider.IProviderSection;
|
|
import com.tridium.nre.security.SecurityInitializer;
|
|
import com.tridium.platcrypto.core.IExtCryptoManager;
|
|
import java.security.cert.Certificate;
|
|
import java.security.cert.X509Certificate;
|
|
import java.util.Enumeration;
|
|
import javax.baja.security.crypto.CertManagerFactory;
|
|
import javax.baja.security.crypto.IKeyStore;
|
|
import javax.baja.spy.Spy;
|
|
import javax.baja.spy.SpyDir;
|
|
import javax.baja.spy.SpyWriter;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public class CryptoPlatformPage
|
|
extends SpyDir {
|
|
private IExtCryptoManager service;
|
|
|
|
public void write(SpyWriter spyWriter) throws Exception {
|
|
Object object;
|
|
Object object2;
|
|
String[] stringArray;
|
|
Object object3;
|
|
if (this.service == null) {
|
|
this.service = (IExtCryptoManager)CertManagerFactory.getInstanceEx();
|
|
}
|
|
try {
|
|
object3 = this.service.getTrustStore();
|
|
if (object3 != null) {
|
|
stringArray = object3.aliases();
|
|
while (stringArray.hasMoreElements()) {
|
|
String string = (String)stringArray.nextElement();
|
|
object2 = object3.getCertificate(string);
|
|
if (!((Certificate)object2).getType().equals("X.509")) continue;
|
|
object = NX509CertificateEntry.make((String)string, (X509Certificate[])new X509Certificate[]{object2}, null);
|
|
this.add(string, (Spy)new CertificatePage((NX509CertificateEntry)object));
|
|
}
|
|
}
|
|
}
|
|
catch (Exception exception) {}
|
|
spyWriter.startProps("FIPS");
|
|
spyWriter.prop((Object)"fips mode", (Object)(SecurityInitializer.isFips() ? "ON" : "OFF"));
|
|
spyWriter.endProps();
|
|
spyWriter.startTable(false);
|
|
spyWriter.trTitle((Object)"Providers", 3);
|
|
spyWriter.w((Object)"<tr>").th((Object)"Provider").th((Object)"Version").th((Object)"Description").w((Object)"</tr>\n");
|
|
object3 = this.service.getProviderInfo().providers();
|
|
while (object3.hasMoreElements()) {
|
|
stringArray = (IProvider)object3.nextElement();
|
|
this.add(stringArray.getName(), (Spy)new ProviderPage((IProvider)stringArray));
|
|
spyWriter.w((Object)"<tr><td>").a(stringArray.getName()).w((Object)"</td>").td((Object)("" + stringArray.getVersion())).w((Object)("<td align='left'>" + stringArray.getDescription() + "</td>")).w((Object)"</tr>");
|
|
}
|
|
spyWriter.endTable();
|
|
spyWriter.startProps("Supported Ciphers");
|
|
stringArray = CryptoSupport.getSupportedCiphers();
|
|
int n = 0;
|
|
while (n < stringArray.length) {
|
|
spyWriter.prop((Object)stringArray[n], (Object)"");
|
|
++n;
|
|
}
|
|
spyWriter.endProps();
|
|
IKeyStore iKeyStore = this.service.getTrustStore();
|
|
if (iKeyStore != null) {
|
|
spyWriter.startTable(false);
|
|
spyWriter.trTitle((Object)"Trusted Certificates", 4);
|
|
spyWriter.w((Object)"<tr>").th((Object)"Alias").th((Object)"Issued To").th((Object)"Issued By").th((Object)"Expires").w((Object)"</tr>\n");
|
|
object2 = iKeyStore.aliases();
|
|
while (object2.hasMoreElements()) {
|
|
object = (String)object2.nextElement();
|
|
X509Certificate x509Certificate = iKeyStore.getCertificate((String)object);
|
|
if (!x509Certificate.getType().equals("X.509")) continue;
|
|
NX509Certificate nX509Certificate = NX509Certificate.make((X509Certificate)x509Certificate);
|
|
spyWriter.w((Object)"<tr><td>").a((String)object).w((Object)"</td>").td(object).td((Object)nX509Certificate.getIssuer()).td((Object)nX509Certificate.getNotAfter()).w((Object)"</tr>");
|
|
}
|
|
spyWriter.endTable();
|
|
}
|
|
}
|
|
|
|
private final /* synthetic */ void this() {
|
|
this.service = null;
|
|
}
|
|
|
|
public CryptoPlatformPage() {
|
|
this.this();
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
private class CertificatePage
|
|
extends SpyDir {
|
|
private NX509CertificateEntry cert;
|
|
|
|
public void write(SpyWriter spyWriter) throws Exception {
|
|
if (CryptoPlatformPage.this.service == null) {
|
|
CryptoPlatformPage.this.service = (IExtCryptoManager)CertManagerFactory.getInstanceEx();
|
|
}
|
|
spyWriter.startProps(this.cert.getAlias());
|
|
spyWriter.prop((Object)"Version", (Object)("v" + this.cert.getCertificate(0).getVersion()));
|
|
spyWriter.prop((Object)"Serial Number", (Object)this.cert.getCertificate(0).getSerialNumber());
|
|
spyWriter.prop((Object)"Issued By", (Object)this.cert.getCertificate(0).getIssuer());
|
|
spyWriter.prop((Object)"Subject", (Object)this.cert.getCertificate(0).getSubject());
|
|
spyWriter.prop((Object)"Not Before", (Object)this.cert.getCertificate(0).getNotBefore());
|
|
spyWriter.prop((Object)"Not After", (Object)this.cert.getCertificate(0).getNotAfter());
|
|
spyWriter.prop((Object)"Signature Algorithm", (Object)this.cert.getCertificate(0).getSignatureAlgorithm());
|
|
spyWriter.prop((Object)"Basic Constraints", (Object)this.cert.getCertificate(0).getBasicConstraints());
|
|
spyWriter.prop((Object)"Key Usage", (Object)this.cert.getCertificate(0).getKeyUsage());
|
|
spyWriter.prop((Object)"Extended Key Usage", (Object)this.cert.getCertificate(0).getExtendedKeyUsage());
|
|
spyWriter.prop((Object)"MD5 Fingerprint", (Object)this.cert.getCertificate(0).getMD5Fingerprint());
|
|
spyWriter.prop((Object)"SHA1 Fingerprint", (Object)this.cert.getCertificate(0).getSHA1Fingerprint());
|
|
spyWriter.endProps();
|
|
}
|
|
|
|
public CertificatePage(NX509CertificateEntry nX509CertificateEntry) {
|
|
this.cert = nX509CertificateEntry;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
private class ProviderPage
|
|
extends SpyDir {
|
|
private IProvider provider;
|
|
|
|
public void write(SpyWriter spyWriter) throws Exception {
|
|
spyWriter.startProps("info");
|
|
spyWriter.prop((Object)"provider", (Object)this.provider.getName());
|
|
spyWriter.prop((Object)"name", (Object)("" + this.provider.getVersion()));
|
|
spyWriter.prop((Object)"description", (Object)this.provider.getDescription());
|
|
spyWriter.endProps();
|
|
Enumeration enumeration = this.provider.sections();
|
|
while (enumeration.hasMoreElements()) {
|
|
IProviderSection iProviderSection = (IProviderSection)enumeration.nextElement();
|
|
spyWriter.startProps(iProviderSection.getName());
|
|
Enumeration enumeration2 = iProviderSection.entries();
|
|
while (enumeration2.hasMoreElements()) {
|
|
IProviderEntry iProviderEntry = (IProviderEntry)enumeration2.nextElement();
|
|
spyWriter.prop((Object)iProviderEntry.getKey(), (Object)iProviderEntry.getValue());
|
|
}
|
|
spyWriter.endProps();
|
|
}
|
|
}
|
|
|
|
public ProviderPage(IProvider iProvider) {
|
|
this.provider = iProvider;
|
|
}
|
|
}
|
|
}
|
|
|