diff --git a/sdk/jme3-core-updatecenters/nbproject/project.xml b/sdk/jme3-core-updatecenters/nbproject/project.xml index 3979d8b02..abc894aed 100644 --- a/sdk/jme3-core-updatecenters/nbproject/project.xml +++ b/sdk/jme3-core-updatecenters/nbproject/project.xml @@ -8,6 +8,8 @@ org.netbeans.modules.autoupdate.services + + 1.47.2 diff --git a/sdk/jme3-core-updatecenters/src/META-INF/services/org.netbeans.spi.autoupdate.KeyStoreProvider b/sdk/jme3-core-updatecenters/src/META-INF/services/org.netbeans.spi.autoupdate.KeyStoreProvider new file mode 100644 index 000000000..1af1a906c --- /dev/null +++ b/sdk/jme3-core-updatecenters/src/META-INF/services/org.netbeans.spi.autoupdate.KeyStoreProvider @@ -0,0 +1 @@ +com.jme3.gde.core.updatecenters.keystore.JmeKeyStoreProvider diff --git a/sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/JmeKeyStoreProvider.java b/sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/JmeKeyStoreProvider.java new file mode 100644 index 000000000..d94e548bd --- /dev/null +++ b/sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/JmeKeyStoreProvider.java @@ -0,0 +1,47 @@ +package com.jme3.gde.core.updatecenters.keystore; + +import java.io.IOException; +import java.io.InputStream; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import org.netbeans.spi.autoupdate.KeyStoreProvider; +import org.openide.util.Exceptions; + +/** + * Loads the jMonkeyEngine SDK Plugins certificates into the AutoUpdate system. + * + * @author Kirill Vainer + */ +public class JmeKeyStoreProvider implements KeyStoreProvider { + + @Override + public KeyStore getKeyStore() { + InputStream in = null; + try { + in = JmeKeyStoreProvider.class.getResourceAsStream("trustedcerts.jks"); + KeyStore store = KeyStore.getInstance("JKS"); + store.load(in, "trustedcerts".toCharArray()); + return store; + } catch (KeyStoreException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } catch (NoSuchAlgorithmException ex) { + Exceptions.printStackTrace(ex); + } catch (CertificateException ex) { + Exceptions.printStackTrace(ex); + } finally { + if (in != null) { + try { + in.close(); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + } + return null; + } + +} diff --git a/sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/trustedcerts.jks b/sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/trustedcerts.jks new file mode 100644 index 000000000..fef5a315c Binary files /dev/null and b/sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/trustedcerts.jks differ