Archive for February, 2010

Tower of Defense

Friday, February 26th, 2010

We are working on a small Tower Defense game inspired by the best one in the genre, in our opinion, called geoDefense.

You can try the last stable version here or the development version here, also it is possible to add comments on the stable version page.

Hope you like it.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Signing JARs for Applet and Webstart

Sunday, February 7th, 2010

We are developing our games using Java and deploying them as Applets and Webstart applications.

By default, applications launched with Java Webstart or as an Applet run in a restricted environment. We are using some technologies which require unrestricted access like Lwjgl, Jinput and custom ClassLoaders. In order to have access to these features, every jar must be signed with a certificate.

Once the jars have been downloaded on the client machine and the signature is validated, the user is requested whether he trust or not the provider of the certificate and if he wants to accept it permanently.

In the beginning, one option is to generate a new certificate every time we sign the jars of an application but this means that although the user might have accepted a certificate permanently, he will have to accept the new one.

A better option is to generate a certificate once and use it every time we sign an application, so that whenever the user accepts our certificate permanently he won’t be bothered again.

A way to create a certificate and manually sign an application with it is explained at Sun's Java Documentation.

In our case, we are using maven as our build tool with maven-webstart-plugin to automatically sign our jars. This plugin allow us to use both options.

In order to easily choose between them, we configure the plugin using properties instead of fixed values, so we can override them with profiles. Using the default values of these properties, the plugin generates a new certificate each time.
If we want to make a public build, we activate a maven profile overriding these properties to use an existent certificate used by all of our applications.

Here are some snippets of our configuration files:

pom.xml - maven-webstart-plugin configuration


		<!-- default values if gen is true -->



We use our company name as a prefix for the property keys in order to have a common scope when setting the values.

pom.xml - default values

	<!-- Properties for keystore generation  -->

settings.xml - profile declaration


In order to build an application for deployment, you can activate this profile from the command line using:

mvn package -PuseDeploymentCertificate

If you have any questions leave a comment.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)