From bcbbf001ce0522a1573aa01a668a15102b8e4907 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 16 Aug 2015 18:44:41 -0400 Subject: [PATCH] sdk plugins: enable NBMs to be signed with jME signature --- .../nbproject/project.xml | 2 + ...g.netbeans.spi.autoupdate.KeyStoreProvider | 1 + .../keystore/JmeKeyStoreProvider.java | 47 ++++++++++++++++++ .../updatecenters/keystore/trustedcerts.jks | Bin 0 -> 802 bytes 4 files changed, 50 insertions(+) create mode 100644 sdk/jme3-core-updatecenters/src/META-INF/services/org.netbeans.spi.autoupdate.KeyStoreProvider create mode 100644 sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/JmeKeyStoreProvider.java create mode 100644 sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/trustedcerts.jks diff --git a/sdk/jme3-core-updatecenters/nbproject/project.xml b/sdk/jme3-core-updatecenters/nbproject/project.xml index 3979d8b023..abc894aede 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 0000000000..1af1a906c3 --- /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 0000000000..d94e548bd7 --- /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 0000000000000000000000000000000000000000..fef5a315c72fece2cb6691f697a3f910eb1d100b GIT binary patch literal 802 zcmezO_TO6u1_mY|W(3phS-Gi2`S~S4zQ4shiJJ_p5qhQumOv$s44Rnk0ddL#W+p}^ zCPqdBE;bIWHji_*EX+&>NrqwuB5cf|EL_68S-$ys*{PMTdFh#XsfKa}G9YngVNn!u z1!qTvAfQEt8U|`?oIrEhzVkA2GKxti=jW9qCYLy5<$_H~1)HLmUzBbjC(dhVYG7e# zW@KbwXy8oXa9J zW9PqF&CcSVtNWcd#pLs>d;T!@=bIm=Zd^*_etu((y3_M#yF5yJi{>~~m{#SzyD}$8 zsMTyu@&cdE7(>plZ?EpmGJgGa$!00hiOYqTp7v!o5?tK))}Zl~feVhG~g`7>KV5;`4yglQtV8D=RxQGjiHu&R{S|WisG2Nl4cZ znVB)^jq~pNU%k6uM}?NE{GBE9)hYQubQbKeczES@F}tv!LlQ@BDU%_?2NvmF zOtr;E=k8Bxu=?C};^j}9S)Up8Cio=2%YPxoYVLa0J8PN2;}yGhZWR7#QQrQ|D!27s U%zC~D+b`dI%qIIj{NSxE01vSWNdN!< literal 0 HcmV?d00001