Sky Software Homepage LogicNP Software Knowledge Base And FAQ

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

INFO: How to validate serials from your software

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



Joined: 18 Jul 2005
Posts: 731

Posted: Mon Jun 01, 2009 6:10 am    Post subject: INFO: How to validate serials from your software

Serials are short cryptographically secure codes in the following form: "63RTV-VCEUD-04CU1-NPU5P-MDHVS-HAVXU-V"

The only reason to use serial codes instead of license codes is because they are short and this can be easily entered by the user. However, a serial code cannot be validated on its own, so using a serial code requires a one time communication with a license service to retrieve a license code against that serial.

To use serials in your software, you must use the CryptoLicense.GetLicenseFromSerial method which connects with the license service to retrieve the license against that serial. If this method succeeds, you can proceed to validate the license using the CryptoLicense.Status property.

Normally, your licensing scheme will use either serials or licenses, however you can also give serials to some users and licenses to others; in this case, you will need to differentiate between them. The following code shows how to do this:
[VB6]
Code:
Dim licOrSerial As String
licOrSerial = "<<serial or license>>" ' may be entered by user
CryptoLicense1.ValidationKey = "<<validation key for your project>>"
CryptoLicense1.LicenseServiceURL = "<<URL of your license service>>"

' Try to validate serial and retrieve license against the serial
Dim result As SerialValidationResult
result = lic.GetLicenseFromSerial(licOrSerial)

If (result = SerialValidationResult.SVR_Failed) Then
    ' 'licOrSerial' is in serial form but validation of serial failed
    MsgBox ("Serial Validation Failed")
    Return
ElseIf (result = SerialValidationResult.SVR_NotASerial) Then
    ' 'licOrSerial' is not a serial but may be a license, set lic.LicenseCode and validate it
    lic.LicenseCode = licOrSerial
ElseIf (result = SerialValidationResult.SVR_Success) Then
    ' CryptoLicense.GetLicenseFromSerial set the lic.LicenseCode with the retrieved license code
    ' validate it
End If

' Validate license by querying Status property
If (lic.Status <> LicenseStatus.LS_Valid) Then
    MsgBox ("License Validation Failed")
    Return
End If
Back to top
Display posts from previous:   
Forum Index -> CryptoLicensing For ActiveX All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group