Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for offline licensing #67

Closed
prarshah opened this issue Mar 19, 2020 · 7 comments
Closed

Support for offline licensing #67

prarshah opened this issue Mar 19, 2020 · 7 comments

Comments

@prarshah
Copy link

If we use this then the same license can be validated on multiple machines, is there any other way to overcome this using license3j?
Thank you in advance.

@verhas
Copy link
Owner

verhas commented Mar 19, 2020

You can use the UUIDCalculator class to calculate a unique UUID for the machine and you can include this calculated value in the license as a UUID feature. In case the calculated UUID and the one included in the license are not the same then the program using License3j can refuse the operation.

Note that the calculation of the UUID may not be reliable on virtual machines and it may result in different UUIDs even on the same machine some times.

@verhas verhas closed this as completed Mar 19, 2020
@prarshah
Copy link
Author

prarshah commented Mar 27, 2020

@verhas
Hello,
Your above-stated solution helped me, thank you.
Also, when I am validating using a public key from the program license.ok is true,
but when I send the same key as a binary feature,
( I am extracting this feature as binary to validate on client side)
the key is getting changed and shows license invalid.
Thanks in advance.

@verhas
Copy link
Owner

verhas commented Mar 27, 2020

There are two things:

  1. Check that the key is the same bit-by-bit where it works and also where you send over, package and unpackage. If they differ then there is some error in the way how you package.

  2. Putting the public key to be used to check the license as a binary feature into the license itself is a total non-sense. Your user just can download License3JRepl and create its own license with its own private and public key and put its own public key into the binary feature and license the program with any parameters as they like.

@prarshah
Copy link
Author

I know was adding the public key for POC so that I don't always have to change the file contains when I found that passing it that way doesn't get validated while the other way it does. Thanks.

@verhas
Copy link
Owner

verhas commented Mar 27, 2020

I do not know what the problem can be. It is binary data after all. If this is the same there as in the source then it will work. I am sure you will find some simple reasons why this special way does not work.

@anaghaShotty123
Copy link

When you said:
Note that the calculation of the UUID may not be reliable on virtual machines and it may result in different UUIDs even on the same machine some times.
I guess using UUIDCalculator for first time validation only will work, then we can carry periodic validations without UUIDs

@verhas
Copy link
Owner

verhas commented Mar 31, 2020

The first time you use the UUID Calculator to get the value to be embedded into the license as a feature. Validation uses UUIDCalculator the second, the third and so on times. And the UUIDCalculator on a virtual machine may return different values each and every time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants