Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Perform activation of a license on behalf of a customer

 
Subscribe to the RSS feed for this forum  Forum Index -> CryptoLicensing For .Net
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Tue Oct 30, 2012 4:16 am    Post subject: HOWTO: Perform activation of a license on behalf of a customer

If some customer does not have an Internet connection, you may wish to perform an activation on behalf of a customer. The procedure to do this is as follows:

1. In the CryptoLicensing UI, paste the customer's license code (generated with the "Limit Machines To" setting) in the bottom text box.

2. From the "Machine Code Provider" tab, select the "Explicitly Specified Machine Code" provider, and paste the machine code for the customer's machine which needs to be activated. Note: Use the CryptoLicense.GetLocalMachineCodeAsString method from your software and display the value returned by this method to the customer for him to Copy-Paste and send to you.

3. Click the "Validate License/Serial" button. The UI will communicate with the license service to activate the license code using the customer's machine code. After activation, the bottom text box will display the machine-locked license code returned by the license service. Send this license code back to the customer.

The same procedure can be done via the Generator API using following code:
[C#]
Code:
       
        string ActivateLicenseOnCustomerBehalf(string customer_license_code, string customer_machine_code)
        {
            CustomCryptoLicense lic = new CustomCryptoLicense(customer_machine_code);
            lic.LicenseCode = customer_license_code;
            lic.ValidationKey = "..."; // Set to actual
            lic.LicenseServiceURL = "..."; // Set to actual

   // Handle the OnGetLocalMachineCode event to provide the customer's machine code during activation.
   lic.OnGetLocalMachineCode += (o, e) => { e.MachineCode = Convert.FromBase64String(customer_machine_code); e.Handled = true; };

            LicenseStatus status = lic.Status; // Validate (activate) the license code

            return lic.LicenseCode; // This now contains the machine-locked license code returned by the license service
        }



[VB.NET]

Code:


Private Function ActivateLicenseOnCustomerBehalf(customer_license_code As String, customer_machine_code As String) As String

   Dim lic As New CustomCryptoLicense(customer_machine_code)
   lic.LicenseCode = customer_license_code
   lic.ValidationKey = "..."   ' Set to actual
   lic.LicenseServiceURL = "..."   ' Set to actual


   ' Handle the OnGetLocalMachineCode event to provide the customer's machine code during activation.
  AddHandler lic.OnGetLocalMachineCode,
      Sub(o As Object, args As GetLocalMachineCodeEventArgs)
          args.MachineCode = Convert.FromBase64String(customer_machine_code)
          args.Handled = True
      End Sub

   Dim status As LicenseStatus = lic.Status   ' Validate (activate) the license code
   Return lic.LicenseCode   ' This now contains the machine-locked license code returned by the license service

End Function
Back to top
Display posts from previous:   
Forum Index -> CryptoLicensing For .Net All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group