Book a Demo

Author Topic: License Management for Custom Add-Ins  (Read 7804 times)

Dominik Rost

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
License Management for Custom Add-Ins
« on: April 17, 2015, 03:57:06 am »
Hi guys,

we have developed an MDG and some Add-ins, which we use in our projects. As our customers frequently ask us to make them available to them, I now start to dig into license management for custom Add-ins, and how EA supports this.

The results of my research were not very satisfactory so far, so I would like to ask you, whether you could give me some hints or pointers to good information sources, everything that helps. I am looking for pretty much the standard stuff: providing licenses to customers, if it is not valid, they should not be able to use the Add-ins and MDG, the license should be valid for a certain period of time, perhaps offering different editions, etc.

Thanks,
Dominik

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #1 on: April 17, 2015, 05:20:14 am »
Make it a good product and your customers are willing to pay. Any licensing can be hacked.

q.

Dominik Rost

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #2 on: April 17, 2015, 06:31:26 am »
Unfortunately, such decisions are not for me to make.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #3 on: April 17, 2015, 07:01:39 am »
For creating a good key management you need to read some good books, ask on SO and play around quite a bit. Here you won't find he answer. I once created a license simply by obfuscating some information in a bit map, adding quite some salt and putting it into a machine that did spit out a char/number combination with some ECC inside. Of course you can implement stronger keys by including some hardware information. But basically: see my first answer ;D

q.

Dominik Rost

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #4 on: April 17, 2015, 07:37:51 am »
Thanks qwerty for the hints but I think I have to clarify:

I am not looking for general advice on how to manage keys but much simpler, specifically for the technical (API) features of EA that could support me.

In particular, I now found the EA_AddInLicenseValidate and EA_AddinLicenseGetDescription events. What I don't quite get yet is what the intended way is to use them to enable or disable the features of my add-in.

Dominik

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #5 on: April 17, 2015, 08:22:12 am »
Those are called when the user enters a license string (that guid-like one) in the Help/Register Keys/Add dialogue. Those keys contain the bits I mentioned.

q.

Dominik Rost

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #6 on: April 17, 2015, 08:46:38 am »
I think the answer might be obvious but I still fail to see it. So, despite the danger of asking a dumb question, again more concretely:

The user has not entered a key in the Keys dialog yet. Therefore EA_AddInLicenseValidate is not called. What do I do so that the user cannot use my add-in?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #7 on: April 17, 2015, 09:24:09 am »
Disable your addin until EA_AddInLicenseValidate is called. It should be called when EA is loading and your key has previously been entered.

I recommend looking at the version 11 help for this topic. There has been some mix-up with the way shared add-in keys are handled in the version 12 help.

It is your responsibility to decide how to encode information into your key, and that is where the advice from qwerty comes in. If you want different features for different versions, it should be encoded into your key in some way.

EA_AddinLicenseGetDescription is just a cosmetic thing, providing a friendly name to your users in the license management dialog.

EA_AddinLicenseValidate just allows your keys to be stored in the keystore in such a way that EA can still say that key is available. You return a string that is used as a prefix for your keys in the keystore. The easiest thing to do with this is simply append the real (encrypted) on the end of this prefix when supplying it to your customers. (Perhaps encoded that the key is to be distributed as shared)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: License Management for Custom Add-Ins
« Reply #8 on: April 17, 2015, 02:16:47 pm »
I used the EA license management for the EA-Matic
I first started out writing my own license key validation, but ended up buying a a commerical library to generate and validate the keys: Cryptolicensing fro .Net from LogicNP

Since EA-Matic is open source sftware you can check out the code on Github: https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/blob/master/EAScriptAddin/EAScriptAddinAddinClass.cs

It works great and save me the trouble of inventing my own license management system.

Geert
« Last Edit: April 17, 2015, 02:17:26 pm by Geert.Bellekens »

Dominik Rost

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #9 on: April 17, 2015, 04:32:29 pm »
Thank you Simon and Geert for your replies.

What I was missing was exactly how you disable your add-in. Geert, what I get from your code is that you also take care of that yourself.

So, what I could do to disable my add-in would be, for example, to have a flag licenseValid, which is false by default. I set it to true when the license could be validated in EA_AddInLicenseValidate. In EA_GetMenuState I check the flag and set IsEnabled accordingly, thus enabling or disabling the menu entries.

Is that correct?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: License Management for Custom Add-Ins
« Reply #10 on: April 17, 2015, 04:42:04 pm »
Yes indeed. You have to manage that yourself.
EA will only provide you with a key. You have to validate it and take the appropriate action is you don't have a valid license.

Geert

Dominik Rost

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: License Management for Custom Add-Ins
« Reply #11 on: April 17, 2015, 05:51:08 pm »
Ok, now I got it. Thank you all for your helpful hints and support.

Best regards,
Dominik