View previous topic :: View next topic |
Author |
Message |
geodesoftware
Joined: 28 Aug 2009 Posts: 5
|
Posted: Fri Nov 13, 2009 8:59 pm Post subject: Invalid data when installing a signed license |
|
|
We are trying to create a custom validator for licenses. The process appears to work, but we get an "invalid data" message when trying to install the signed license. Any help would be greatly apprecaited. Code follows:
Dim provider As New AuthenticatedLicenseProvider
Dim licpara As New AuthenticatedLicenseParameters
licpara.ReadFromString(LICENSE_PARAMETERS)
licpara.ProductPassword = "PASSWORD"
licpara.AuthenticationPassword = "AUTHPASSWORD"
Dim oAuth As AuthenticatedLicense
Dim sLicensePath As String = "C:\License Files\"
Dim oLic As AuthenticatedLicense
oLic = provider.ReadLicense(sLicensePath & "License.lic")
oAuth = provider.SignLicense(licpara, oLic.LicenseKey, oLic.ComputerID)
provider.WriteLicense(sLicensePath & "v_License.lic", oAuth) |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Nov 13, 2009 11:52 pm Post subject: |
|
|
I think the problem is that you are using the same LICENSE_PARAMETERS that you include in your application for validating the license. These parameters do not include the private keys necessary for generating and authenticating licenses.
To get the parameters required for authenticating a license you need to export the settings to an Infralution License Settings (.ils) file from LicenseKeyGenerator or LicenseTracker. This will include the private keys required. Then you can read this in your application:
Code: | Dim paramers as new AuthenticatedLicenseParameters
Using reader As New XmlTextReader(fileName)
parameters = parameters.Read(reader)
End Using
|
Alternatively you can copy the contents of the .ils file to a string in your code and use the ReadFromString method to initialize the parameters as your code did. _________________ Infralution Support |
|
Back to top |
|
|
geodesoftware
Joined: 28 Aug 2009 Posts: 5
|
Posted: Tue Nov 17, 2009 8:02 pm Post subject: |
|
|
I no longer have the license tracker DB, just the authentication server. Is there a way to export the correct key from the authentication server? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Nov 17, 2009 9:27 pm Post subject: |
|
|
geodesoftware wrote: | I no longer have the license tracker DB, just the authentication server. |
How are you going to generate license keys then?
Quote: | Is there a way to export the correct key from the authentication server? |
Yes you can copy the required settings from the AuthenticationServerSettings.xml file. You want to copy the whole "AuthenticationLicenseParameters" XML element. _________________ Infralution Support |
|
Back to top |
|
|
geodesoftware
Joined: 28 Aug 2009 Posts: 5
|
Posted: Mon Nov 30, 2009 6:49 pm Post subject: |
|
|
We are generating keys by using the autentication service. We have all of the authentication service settings and service db, we just don't have license tracker.
So we just read AuthenticationLicenseParameters section from the autehticationsettings file into AuthenticatedLicenseParameters which we can then use to call the signlicense method? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Nov 30, 2009 9:23 pm Post subject: |
|
|
Quote: | We are generating keys by using the autentication service. We have all of the authentication service settings and service db, we just don't have license tracker. |
The authentication service (unless you have modified it) doesn't generate keys - it just authenticates them and signs the license file. The AuthenticationSettings file doesn't contain the product password required to generate new keys.
Quote: | So we just read AuthenticationLicenseParameters section from the autehticationsettings file into AuthenticatedLicenseParameters which we can then use to call the signlicense method? |
You can use these license parameters to sign files. _________________ Infralution Support |
|
Back to top |
|
|
|