Padlock 1.x to 2.x Migration Guide

Overview

Padlock 2.x retains Validation compatibility with the 1.x series, meaning it is able to validate licenses created with previous versions of Padlock.  This was done with the strict requirement that existing 1.x licenses in the field must be able to validate with new versions of Padlock.

What's Changed:

What Will Work:

What Won't Work:

Suggested Migration Path:

For those who wish to upgrade to Padlock 2.x and keep their existing 1.x licenses in place:

Generate a new public/private key pair - The new pair is DSA based, and will be used to generate new licenses as well as validate them in the field.  Hold on to your old keypair as you will still need the public key to validate the older licenses.

Embed both sets of public keys into your application - It's suggested you simply place the version 2 public key directly under version 1.  Depending on the license being validated, you'll need to pass 1 of them into the Validator's constructor.

When validating a license, take note of the license's version number - Padlock 2.0 added a new method to the License instance - getLicenseVersion(). Your License instance automatically determines the version.  1 = Padlock 1.x and 2 = Padlock 2.x.  A simple tertiary should be all that's needed to use the proper key:

private static final PUB_KEY_V1 = "0123456789abcdef......";

private static final PUB_KEY_V2 = "0123456789abcdef......";

License l;

// Import either v1 or v2 license file here

String pubKey = (l.getLicenseVersion() == 1 ? PUB_KEY_V1 : PUB_KEY_V2);

Validator v = new Validator(l, pubKey);

The Validator works identically from this point on.  It's suggested that your property naming format remain the same between the old and new licenses, simply for the sake of simplicity.

This concludes the Padlock Migration Guide.  Please direct any questions or concerns to support@padlocksoftware.net.


Browse Space

- Pages
- News
- Labels
- Attachments
- Bookmarks
- Mail
- Advanced

Explore Confluence

- Popular Labels
- Notation Guide

Your Account

Log In

 

Other Features

Add Content