	How to check a named-user license key and get
	options embedded in the key:
	---------------------------------------------

The following is a very basic way to check a named-user
license key and obtain the options that are contained in
the key, for a typical single-user desktop application.

It is preferable to use the custom key handler to implement
a shared-secret mechanism.  It is also preferable to embed
encrypted information such as the creation date into the 
custom cookie to further foil hackers.

To license protect your application, integrate your application
logic to code similar to the following, and distribute the
ezlm run time library "ezlicrun11.jar" as part of your product
packaging.

Lines of code prefixed with the comment "EZLM code" represent
what you code to interface with the ezlm run time library.


// imports
//EZLM code
import com.vs.ezlicrun.*; // import ezlm runtime library
:
	// First obtain the user login name
	// (You could get the user name from any
	// number of places, including the OS user)
	// Note: this code is orthogonal to ezlm.
	String userName = 
		(String) JOptionPane.showInputDialog(
					null, 
					"Enter User Name:", "Login", 
					JOptionPane.PLAIN_MESSAGE);
	userName = userName.trim();
	:

	// Check the license key that is already obtained 
	// from the registry / property file, in this example into 
	// a "config" class.  For examples on how to read a license
	// key from an exported file, see "jdemo.java".
	// EZLM code
	EzLicenseInfo licenseInfo = new EzLicenseInfo();
	try {
		// EZLM code
		int warnings = 
			licenseInfo.checkSingleUserLicenseKeyBasic(
					config.getLicenseKey(), // NOTE: *not* ezlm code
					0, 0, 0, 0, 0,
					userName);
	} catch (EzLicExceptionBase eek) {
		JOptionPane.showMessageDialog(
						(JComponent)null,
						"You are not licensed to use this product. " +
						"Please contact technical support.",
						"Licensing Error",
						JOptionPane.ERROR_MESSAGE);
		System.exit(1);
	}

	// Process the licensing options
	// In this simple example, we're assuming the presence
	// of an option signifies it's enabled.
	// EZLM code
	String optionsStr = licenseInfo.getOptions();
	if (optionsStr != null)
		// produce a hashmap so as to be able to lookup options
		// EZLM code
		HashMap options = EzLicenseCustomUtil.parseString(optionsStr);

	:
	// somewhere in the app, we want to disallow use of a module if 
	// it isn't licensed.
	if (options.get("routerModule") == null) {
		JOptionPane.showMessageDialog(
						(JComponent)null,
						"You are not licensed to use the router module. " +
						"Please contact technical support.",
						"Licensing Error",
						JOptionPane.ERROR_MESSAGE);
		return;
	}

	:
	// somewhere else in the app, we want to similarly gate the use
	// of another corresponding module
	if (options.get("firewallModule") == null) {
		JOptionPane.showMessageDialog(
						(JComponent)null,
						"You are not licensed to use the firewall module. " +
						"Please contact technical support.",
						"Licensing Error",
						JOptionPane.ERROR_MESSAGE);
		return;
	}

	:

				-x-

