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 

Another ShareIt Integration Question

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



Joined: 27 Nov 2008
Posts: 18

PostPosted: Tue Dec 02, 2008 5:39 pm    Post subject: Another ShareIt Integration Question Reply with quote

Just bought ILS and it was very easy to implement the custom generator for my needs and custom app code into my product. Btw, I use the EncryptedLicense keys for my App with some custom product info in it.

Now I am struggling with the ShareIt integration and have a couple of questions:
1. I read, that I need a license on the machine where I call the GenerateKey method. The KeyGen I plan to upload to ShareIt will not have a license. As far as I remember is the license "locked" to the Computer ID as well. What can I do to call this method in unknown environments?
2. The GenerateKey method needs me to pass the serial no parameter, which - as I understand - should be incremented. I don't know anything about the ShareIt environment but how should I implement that. I'm not sure if it's save to write a file or write to the registry on their server. What do you suggest?
3. I tried the approach to include the source files (mainly to circumvent the need for the .lic file - as someone in this forum already was told) to the keygen project. I ended up having a lot of references (even System.Windows.Forms) because of some dependencies of the Utilities and the licensing dialog. Any chance to get some documentation, what classes, methods are needed and how exactly to disable the check for the license?
4. In general, it would be nice to post a simple code snippet on how to generate a license key for a custom app with the minimum requirements and dependencies to deploy such code to an environment like the one of ShareIt. If you look at the ShareIt Keygen SDK, there's only one method (GenerateKey) which is relevant to create the license key. Providing a sample code for this method would be the lifesaver !

Thanks in advance for your help...
cheers
Stefan
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Dec 02, 2008 10:09 pm    Post subject: Reply with quote

Including the source code classes in your key generator application is the way to bypass requirement for an ILS license. You don't have to do anything special because the code that checks the ILS license is in a condition compile block which is turned on in the Infralution.Licensing project by a specific compilation constant being defined. Since your project won't define this constant the licensing check code will not be compiled.

The classes you need to include are the same as you need to include in a normal application that uses ILS. The requirements for this are documented in the Redistributables and Source Code section of the ILS help.

Have a look at the source code for the License Key Generator app for an example of how to generate license keys. In particular note that the LicenseParameters you use to generate license keys must include the ProductPasswordand other private parameters. To get these you need to export the license parameters to a text file as the Validation Parameters you include in your application code don't include the private parameters required to generate keys.

Below is a code snippet to generate a key given product info and serial no. Your key generator will need to keep track of serial numbers and increment them.

Code:
private string GenerateLicenseKey(int serialNo, string productInfo)
{
    const string LICENSE_PARAMETERS =
        @"<EncryptedLicenseParameters>
            <ProductName>My Product</ProductName>
            <ProductPassword>TEST</ProductPassword>
            <RSAKeyValue>
            <Modulus>zX4VW8ukM8aBMgIeYOhBsH6s+UlbYM3jv3kGy59NA5vBDxaCRclowIXkHC+Ue+ua0am7brgWss/N7PetcaleXWUJacRaisC5yjl3WK2UWoPQ37HjKijXM++eCOq+mEProZYO7Ux2Q8aA13glAXn5Ry9OePA3YmD4f+658k0x1AE=</Modulus>
            <Exponent>AQAB</Exponent>
            <P>9uIKCgjhqB+1NwNroNv/daLMyDWwUuKclY8F1C80MWKXNoEmpaIxHHiv4MfD/S2gF/AfP8swDOKakJ9Fpby6mw==</P>
            <Q>1RTAMN+EJs3xvQjyGx8N6+7GQ5MR6w+oy4i/bQlKVndwtDrJ4H4qCwJbxhDqlb8udlosll7Akl25dFETDbhXkw==</Q>
            <DP>jguR8SIZC41qy0NJipzph3pqzoqtb5L4usg2d1XNdtid3ftDDCucjCAYOYFWj3XP1dYPdLnoZJGAktNA1FIZHw==</DP>
            <DQ>JYUl4nU5O+v/qR2uJABv3x+IYdW/zfhP7KcDrht4r4kQm2vOqG0O0il0J4hLBltHvydZupCssBk40raD+GKBaQ==</DQ>
            <InverseQ>AEi1n+Hx9KnkmQkRnFJVrMwUHEsGL1jlYVLsiyx8n8Dym8OIa6+cDCcI5sfqxnQyNq8WiHZ+D4LO9aCTSeKIXg==</InverseQ>
            <D>VFhwQ+FuYKIV3YTpGzW54MveC+SEUVOxK6Jtm56jadvAfoTqq+Jj0MIkQz10YPjv7ycP+/4rsvGAwMdYtdKjHE3USw+LfoaRF9kidCY+ml54ROnY5NaRaSmvCo7GsEF1p/GeeoqeMIE1S9d40H5trAXLRQfwhMTS55NqYFWuGJE=</D>
            </RSAKeyValue>
            <DesignSignature>VyWFO92791568I4C/iw5bNi8y4yhv0GE4/m+5MWMsAlOdIe7GWr3v57rxtMo9iPyfMyHJhLLJHBkuANsI0gWUiaAfyMhpHdM893mkc4PEz8KS+ZSvUCVklNWiPWPQUT0cDd6FSxCVjujBoZmIGYe4KglA8vjd2YxtHm7ZgTPYG4=</DesignSignature>
            <RuntimeSignature>YCO+TnF/qnmLuY+NiINXPal3uSZiBuCvlI6RUDtsoVxSV5eld0P4ava+m9+viKYMBLd/tOIiNH+Jh1ZQIMeWtDNndxyoRr2S1eRp0fb5XYHk8bvUUJB81a9eSrJ366YgZwzXuL2oNw4hilZBQCgUgDWEwD4c2meD0dkE5MkTOdI=</RuntimeSignature>
            <KeyStrength>7</KeyStrength>
         </EncryptedLicenseParameters>";

    EncryptedLicenseParameters parameters = new EncryptedLicenseParameters();
    parameters.ReadFromString(LICENSE_PARAMETERS);
    EncryptedLicenseProvider provider = new EncryptedLicenseProvider();
    return provider.GenerateKey(parameters, productInfo, serialNo);
}

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Gefflix



Joined: 27 Nov 2008
Posts: 18

PostPosted: Wed Dec 03, 2008 12:10 am    Post subject: Reply with quote

Thanks for your support, I will try to implement it the way you just explained.

Infralution wrote:

Below is a code snippet to generate a key given product info and serial no. Your key generator will need to keep track of serial numbers and increment them.

About remembering the serial number. Do you have an idea, how/where someone would store this? I mean, you guys seem to have experience with that stuff and was wondering if you can share some hints.

cheers
Stefan
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Dec 03, 2008 1:46 am    Post subject: Reply with quote

Quote:
About remembering the serial number. Do you have an idea, how/where someone would store this? I mean, you guys seem to have experience with that stuff and was wondering if you can share some hints.


It depends a little bit on what permissions ShareIt give your key generator. You could just try saving the serial no to a file in the executable directory. Alternatively you could investigate the .NET framework IsolatedStorage mechanism - you should have permissions to write to IsolatedStorage. Maybe ask ShareIt their recommendation.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Gefflix



Joined: 27 Nov 2008
Posts: 18

PostPosted: Wed Dec 03, 2008 9:02 am    Post subject: Reply with quote

Thanks, I will ask them as well.

One last thing: Since it seems important to increment the serial number, how should I handle manual key creation. I mean, occasionally I need to create keys myself for special purposes and it's still not clear to me what purpose the serial number has.

Would it be advisable to increment the serial number by 2 each time I sell a key? So that automatic keys are all even numbers and manually created keys are all odd numbers?

cheers
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Dec 03, 2008 10:05 pm    Post subject: Reply with quote

Normally you would start your automated serial nos from a different serial no (eg 10000) to allow space for you manually generated serial nos.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Gefflix



Joined: 27 Nov 2008
Posts: 18

PostPosted: Thu Dec 04, 2008 9:18 am    Post subject: Reply with quote

Great support, great product, thanks again.

cheers
Stefan
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