diff options
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/SimpleXMLTrustManager.java (renamed from pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ASITTrustManager.java) | 23 | ||||
-rw-r--r-- | pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java | 2 | ||||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-01a.crt | bin | 1111 -> 0 bytes | |||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-02a.crt | bin | 975 -> 0 bytes | |||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-03a.crt | bin | 975 -> 0 bytes | |||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/certificates.xml | 7 | ||||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/mccDemoAuxRoot.crt | bin | 0 -> 1486 bytes | |||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/mccDemoTLS.crt | bin | 0 -> 2063 bytes | |||
-rw-r--r-- | pdf-over-gui/src/main/resources/certificates/used_certificates.xml | 8 |
9 files changed, 20 insertions, 20 deletions
diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ASITTrustManager.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/SimpleXMLTrustManager.java index f4e6be70..d08dcfe5 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/ASITTrustManager.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/SimpleXMLTrustManager.java @@ -36,12 +36,15 @@ import org.w3c.dom.NodeList; /** * */ -public class ASITTrustManager implements X509TrustManager { +public class SimpleXMLTrustManager implements X509TrustManager { /** * SLF4J Logger instance **/ private static final Logger log = LoggerFactory - .getLogger(ASITTrustManager.class); + .getLogger(SimpleXMLTrustManager.class); + + private static final String certificateList = "/certificates/certificates.xml"; //$NON-NLS-1$ + /* * The default X509TrustManager returned by SunX509. We'll delegate @@ -60,7 +63,7 @@ public class ASITTrustManager implements X509TrustManager { * * @throws Exception */ - public ASITTrustManager() throws Exception { + public SimpleXMLTrustManager() throws Exception { // create a "default" JSSE X509TrustManager. TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); //$NON-NLS-1$ @@ -83,16 +86,14 @@ public class ASITTrustManager implements X509TrustManager { * A-Trust Certificates */ - KeyStore atrustKeyStore = KeyStore.getInstance(KeyStore + KeyStore myKeyStore = KeyStore.getInstance(KeyStore .getDefaultType()); - atrustKeyStore.load(null); - - String usedCertificates = "/certificates/used_certificates.xml"; //$NON-NLS-1$ + myKeyStore.load(null); Document doc = DocumentBuilderFactory.newInstance() .newDocumentBuilder() - .parse(this.getClass().getResourceAsStream(usedCertificates)); + .parse(this.getClass().getResourceAsStream(certificateList)); Node certificates = doc.getFirstChild(); @@ -117,7 +118,7 @@ public class ASITTrustManager implements X509TrustManager { continue; } - String certResource = "/certificates/" + certificateNode.getTextContent() + ".crt"; //$NON-NLS-1$ //$NON-NLS-2$ + String certResource = "/certificates/" + certificateNode.getTextContent(); //$NON-NLS-1$ X509Certificate cert = (X509Certificate) CertificateFactory .getInstance("X509"). //$NON-NLS-1$ @@ -125,7 +126,7 @@ public class ASITTrustManager implements X509TrustManager { this.getClass().getResourceAsStream( certResource)); - atrustKeyStore.setCertificateEntry(certificateNode.getTextContent(), cert); + myKeyStore.setCertificateEntry(certificateNode.getTextContent(), cert); log.debug("Loaded certificate : " + certResource); //$NON-NLS-1$ @@ -134,7 +135,7 @@ public class ASITTrustManager implements X509TrustManager { } } - tmf.init(atrustKeyStore); + tmf.init(myKeyStore); tms = tmf.getTrustManagers(); diff --git a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java index e3da8076..add31972 100644 --- a/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java +++ b/pdf-over-gui/src/main/java/at/asit/pdfover/gui/workflow/states/mobilebku/TrustedSocketFactory.java @@ -51,7 +51,7 @@ public class TrustedSocketFactory implements ProtocolSocketFactory { private static SSLSocketFactory getFactory() throws NoSuchAlgorithmException, KeyManagementException, Exception { SSLContext sslContext = SSLContext.getInstance("TLS"); //$NON-NLS-1$ - sslContext.init(null, new TrustManager[] { new ASITTrustManager() }, + sslContext.init(null, new TrustManager[] { new SimpleXMLTrustManager() }, new java.security.SecureRandom()); return sslContext.getSocketFactory(); diff --git a/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-01a.crt b/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-01a.crt Binary files differdeleted file mode 100644 index f9fef65f..00000000 --- a/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-01a.crt +++ /dev/null diff --git a/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-02a.crt b/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-02a.crt Binary files differdeleted file mode 100644 index 36a442b8..00000000 --- a/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-02a.crt +++ /dev/null diff --git a/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-03a.crt b/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-03a.crt Binary files differdeleted file mode 100644 index ab9e0cd7..00000000 --- a/pdf-over-gui/src/main/resources/certificates/A-Trust-Qual-03a.crt +++ /dev/null diff --git a/pdf-over-gui/src/main/resources/certificates/certificates.xml b/pdf-over-gui/src/main/resources/certificates/certificates.xml new file mode 100644 index 00000000..44609e4f --- /dev/null +++ b/pdf-over-gui/src/main/resources/certificates/certificates.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<certificates> + <certificate>A-Trust-nQual-01a.crt</certificate> + <certificate>A-Trust-nQual-03.crt</certificate> + <certificate>mccDemoAuxRoot.crt</certificate> + <certificate>mccDemoTLS.crt</certificate> +</certificates>
\ No newline at end of file diff --git a/pdf-over-gui/src/main/resources/certificates/mccDemoAuxRoot.crt b/pdf-over-gui/src/main/resources/certificates/mccDemoAuxRoot.crt Binary files differnew file mode 100644 index 00000000..1649a57b --- /dev/null +++ b/pdf-over-gui/src/main/resources/certificates/mccDemoAuxRoot.crt diff --git a/pdf-over-gui/src/main/resources/certificates/mccDemoTLS.crt b/pdf-over-gui/src/main/resources/certificates/mccDemoTLS.crt Binary files differnew file mode 100644 index 00000000..2cd88af2 --- /dev/null +++ b/pdf-over-gui/src/main/resources/certificates/mccDemoTLS.crt diff --git a/pdf-over-gui/src/main/resources/certificates/used_certificates.xml b/pdf-over-gui/src/main/resources/certificates/used_certificates.xml deleted file mode 100644 index 255cbe9d..00000000 --- a/pdf-over-gui/src/main/resources/certificates/used_certificates.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<certificates> - <certificate>A-Trust-nQual-01a</certificate> - <certificate>A-Trust-nQual-03</certificate> - <certificate>A-Trust-Qual-01a</certificate> - <certificate>A-Trust-Qual-02a</certificate> - <certificate>A-Trust-Qual-03a</certificate> -</certificates>
\ No newline at end of file |