Standard.Licensing icon indicating copy to clipboard operation
Standard.Licensing copied to clipboard

The license signature and data does not match.

Open dhineshmuthuvel opened this issue 5 years ago • 7 comments

Followed the steps mentioned in the readme, however getting the error in the validationfailures.ToList(). Any Idea on this ?

The license signature and data does not match. This usually happens when a license file is corrupted or has been altered.

public static bool ValidateLicense(string publicKey)
        {
            var readAllLines = File.ReadAllText(@"D:\Work Items\KiteConnect\LicensingPOC\LicensingPOC\License.lic");
            var license = License.Load(readAllLines);

            var validationFailures = license.Validate()
                .ExpirationDate()
                .When(lic => lic.Type == LicenseType.Trial)
                .And()
                .Signature(publicKey).AssertValidLicense();

            List<IValidationFailure> failures = validationFailures.ToList();

            return !failures.Any();
        }

dhineshmuthuvel avatar Jan 05 '20 20:01 dhineshmuthuvel

Are you using the File.WriteAllText("License.lic", license.ToString(), Encoding.UTF8); way to save the license to a file?

If so try the second one, ie: using (var xmlWriter = System.Xml.XmlWriter.Create(filePath)) { license.Save(xmlWriter); }

ZiTsi avatar Jan 07 '20 10:01 ZiTsi

I had the same issue. Your solution (using seconde one with xmlWriter) resolved the issue.

ChristophBachmann avatar Jan 16 '20 08:01 ChristophBachmann

Mine does not work at all. Neither the first, neither the second solution, both of them generates "Data at the root level is invalid: Line 1, position 1."

valimaties avatar Jun 22 '20 16:06 valimaties

Offtopic question. Is this project still maintained?

leonkosak avatar Nov 05 '20 18:11 leonkosak

Offtopic question. Is this project still maintained?

I don't think so @leonkosak

valimaties avatar Nov 05 '20 18:11 valimaties

Yes, it was just upgraded to .NET 8.

skst avatar Mar 29 '24 04:03 skst