sdk plugins: enable NBMs to be signed with jME signature

experimental
Kirill Vainer 10 years ago
parent afe5b91605
commit bcbbf001ce
  1. 2
      sdk/jme3-core-updatecenters/nbproject/project.xml
  2. 1
      sdk/jme3-core-updatecenters/src/META-INF/services/org.netbeans.spi.autoupdate.KeyStoreProvider
  3. 47
      sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/JmeKeyStoreProvider.java
  4. BIN
      sdk/jme3-core-updatecenters/src/com/jme3/gde/core/updatecenters/keystore/trustedcerts.jks

@ -8,6 +8,8 @@
<module-dependencies>
<dependency>
<code-name-base>org.netbeans.modules.autoupdate.services</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<specification-version>1.47.2</specification-version>
</run-dependency>

@ -0,0 +1 @@
com.jme3.gde.core.updatecenters.keystore.JmeKeyStoreProvider

@ -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;
}
}
Loading…
Cancel
Save