Skip to content

Commit

Permalink
sdk plugins: enable NBMs to be signed with jME signature
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowislord committed Aug 16, 2015
1 parent afe5b91 commit bcbbf00
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/jme3-core-updatecenters/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.jme3.gde.core.updatecenters.keystore.JmeKeyStoreProvider
Original file line number Diff line number Diff line change
@@ -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;
}

}
Binary file not shown.

0 comments on commit bcbbf00

Please sign in to comment.