View previous topic :: View next topic |
Author |
Message |
ssc
Joined: 29 Apr 2011 Posts: 2
|
Posted: Fri Apr 29, 2011 1:27 pm Post subject: Storing License File in own storage |
|
|
Dear Madam or Sir,
The LicenseProviders have methods to install and uninstall the license file. Als GetLicense refers to the license file stored by install/uninstall.
I can't store a license file on any file storage directly (the application I want to use infralution licensing for is a plugin for a serverside application. Code Acces Security does not provide me any kind of file storage).
Is it possible to provide a Stream where the LicenseProvider installs the license to and loads the license from?
thank you, stefan schnuderl |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Apr 29, 2011 11:56 pm Post subject: |
|
|
There are a few possible ways of doing this.
The simplest way is probably to override the EncryptedLicenseProvider ReadKeyFromFile and WriteKeyToFile methods (for encrypted licenses) or the AuthenticatedLicenseProvider WriteLicense and ReadLicense methods (for authenticated licenses). You would ignore the filename parameter and create your own stream to read/write. You would also need to override the UninstallLicense method to remove the license.
Another possibility which is a bit more work is to handle storing and loading the license key or license yourself. For encrypted licenses you just need to store the key, for authenticated licenses you must save/load the whole AuthenticatedLicense object. You can use the AuthenticatedLicenseProvider.WriteLicense(XmlTextWriter) method and ReadLicense(XmlTextReader) methods to do this. After loading the license you need to validate it. For encrypted licenses you just call the EncryptedLicenseProvider.ValidateLicenseKey method. For authenticated licenses you call AuthenticatedLicenseProvider.ValidateLicense. You need to also change the appropriate LicenseInstallForm to override the InstallLicenseKey method (for encrypted licenses) or the SaveLicense method (for authenticated licenses). _________________ Infralution Support |
|
Back to top |
|
|
ssc
Joined: 29 Apr 2011 Posts: 2
|
Posted: Tue May 03, 2011 7:10 pm Post subject: thank you, that worked |
|
|
|
|
Back to top |
|
|
|