N
Nak
Hi there,
I just made my own license provider (at last!) that uses signed XML
license files. When the license provider gets the license it does the
following,
*At runtime
1) Gets the signed XML license file from the calling assemblys resources
2) Gets the public RSA key from the calling assemblys resources
3) Attempts the validate the signature
*At design time
1) Gets the signed XML license file from same path the binary is
executing from (i.e. Obj\Debug or Obj\Release)
2) Gets the public RSA key from same path the binary is executing from
(i.e. Obj\Debug or Obj\Release)
3) Attempts the validate the signature
This works fine, and it seems to be quite a reliable method of control
licensing with 1 exception. It's damn slow!
Check this out, I timed the creation and disposal of 2 types of control,
1 licensed via my method and 1 not licensed at all. I timed how many could
be created in 1 minute in both circumstances and these were my results,
* I created 3,456,717 un-licensed controls in 1 minute
* I created 438 licensed controls in 1 minute
On closer inspection it turns out that the GetLicense method starts at
about 578ms then jumps around 94ms and 250ms each time. So obviously this
greatly reduces the speed of creating large numbers of controls. I would
ideally like to speed this up and I believe that there is a way to cache the
license file and possibly the public key too.
So that leaves me asking if anyone has any idea how I can create my own
LicenseContext class and get it passed to my license provider so that I can
use the SetSavedLicenseKey and the GetSavedLicenseKey methods (unless of
course there is another way around this). I have found an example from the
Windows Forms web site that creates a licensed component class, but I'm not
quite sure if this is what I need or not as this would intil creating lots
of derived classes from the licensed one.
Anyways, thanks for your time and I look forward to any suggestions!
Nick.
I just made my own license provider (at last!) that uses signed XML
license files. When the license provider gets the license it does the
following,
*At runtime
1) Gets the signed XML license file from the calling assemblys resources
2) Gets the public RSA key from the calling assemblys resources
3) Attempts the validate the signature
*At design time
1) Gets the signed XML license file from same path the binary is
executing from (i.e. Obj\Debug or Obj\Release)
2) Gets the public RSA key from same path the binary is executing from
(i.e. Obj\Debug or Obj\Release)
3) Attempts the validate the signature
This works fine, and it seems to be quite a reliable method of control
licensing with 1 exception. It's damn slow!
Check this out, I timed the creation and disposal of 2 types of control,
1 licensed via my method and 1 not licensed at all. I timed how many could
be created in 1 minute in both circumstances and these were my results,
* I created 3,456,717 un-licensed controls in 1 minute
* I created 438 licensed controls in 1 minute
On closer inspection it turns out that the GetLicense method starts at
about 578ms then jumps around 94ms and 250ms each time. So obviously this
greatly reduces the speed of creating large numbers of controls. I would
ideally like to speed this up and I believe that there is a way to cache the
license file and possibly the public key too.
So that leaves me asking if anyone has any idea how I can create my own
LicenseContext class and get it passed to my license provider so that I can
use the SetSavedLicenseKey and the GetSavedLicenseKey methods (unless of
course there is another way around this). I have found an example from the
Windows Forms web site that creates a licensed component class, but I'm not
quite sure if this is what I need or not as this would intil creating lots
of derived classes from the licensed one.
Anyways, thanks for your time and I look forward to any suggestions!
Nick.