Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Storing License File in own storage

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
ssc



Joined: 29 Apr 2011
Posts: 2

PostPosted: Fri Apr 29, 2011 1:27 pm    Post subject: Storing License File in own storage Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Apr 29, 2011 11:56 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
ssc



Joined: 29 Apr 2011
Posts: 2

PostPosted: Tue May 03, 2011 7:10 pm    Post subject: thank you, that worked Reply with quote

Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group