[GH-ISSUE #11] The license signature and data does not match. #11

Open
opened 2026-02-26 01:35:46 +03:00 by kerem · 7 comments
Owner

Originally created by @dhineshmuthuvel on GitHub (Jan 5, 2020).
Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/11

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();
        }
Originally created by @dhineshmuthuvel on GitHub (Jan 5, 2020). Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/11 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(); } ```
Author
Owner

@ZiTsi commented on GitHub (Jan 7, 2020):

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); }

<!-- gh-comment-id:571532539 --> @ZiTsi commented on GitHub (Jan 7, 2020): 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); } `
Author
Owner

@ChristophBachmann commented on GitHub (Jan 16, 2020):

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

<!-- gh-comment-id:575042178 --> @ChristophBachmann commented on GitHub (Jan 16, 2020): I had the same issue. Your solution (using seconde one with xmlWriter) resolved the issue.
Author
Owner

@valimaties commented on GitHub (Jun 22, 2020):

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."

<!-- gh-comment-id:647623008 --> @valimaties commented on GitHub (Jun 22, 2020): 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."
Author
Owner

@leonkosak commented on GitHub (Nov 5, 2020):

Offtopic question. Is this project still maintained?

<!-- gh-comment-id:722565978 --> @leonkosak commented on GitHub (Nov 5, 2020): Offtopic question. Is this project still maintained?
Author
Owner

@valimaties commented on GitHub (Nov 5, 2020):

Offtopic question. Is this project still maintained?

I don't think so @leonkosak

<!-- gh-comment-id:722570176 --> @valimaties commented on GitHub (Nov 5, 2020): > Offtopic question. Is this project still maintained? I don't think so @leonkosak
Author
Owner

@skst commented on GitHub (Mar 29, 2024):

Yes, it was just upgraded to .NET 8.

<!-- gh-comment-id:2026635693 --> @skst commented on GitHub (Mar 29, 2024): Yes, it was just upgraded to .NET 8.
Author
Owner

@pjsgsy commented on GitHub (Jan 23, 2025):

I just wanted to say thanks. I was suffering from the same issue. After 60 minutes of head-scratching, I found this. The solution works for me. For some reason, if you echo the XML and manually save that as a file, validation fails. Writing the file with the call produces a file that validates. Happy days :) Thanks for a great little library!

<!-- gh-comment-id:2609459096 --> @pjsgsy commented on GitHub (Jan 23, 2025): I just wanted to say thanks. I was suffering from the same issue. After 60 minutes of head-scratching, I found this. The solution works for me. For some reason, if you echo the XML and manually save that as a file, validation fails. Writing the file with the call produces a file that validates. Happy days :) Thanks for a great little library!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Standard.Licensing#11
No description provided.