[GH-ISSUE #18] How to lock the generated license to only one computer? #18

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

Originally created by @cmabox on GitHub (Mar 27, 2021).
Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/18

I tested the generated license and it can be used on multiple computers. Can it be locked to only one computer? How? Thanks.

Originally created by @cmabox on GitHub (Mar 27, 2021). Original GitHub issue: https://github.com/junian/Standard.Licensing/issues/18 I tested the generated license and it can be used on multiple computers. Can it be locked to only one computer? How? Thanks.
Author
Owner

@hiepgia commented on GitHub (Apr 20, 2021):

You can simple generate Hardware ID (Example: libc.hwid) and add it to license via WithAdditionalAttributes.

<!-- gh-comment-id:823125868 --> @hiepgia commented on GitHub (Apr 20, 2021): You can simple generate Hardware ID (Example: libc.hwid) and add it to license via WithAdditionalAttributes.
Author
Owner

@AntiGuideAkquinet commented on GitHub (Feb 24, 2023):

I believe this would be an interesting feature to add the library.

As recommended saeidjoker/libc.hwid could be used if we modify the targeted librarys as suggested in #20

I would suggest a generation caller syntax like:

var license = License.New()  
    .WithUniqueIdentifier(Guid.NewGuid())  
    .As(LicenseType.Trial)  
    .ExpiresAt(DateTime.Now.AddDays(30))  
    .WithMaximumUtilization(5)
    .WithHardwareIds(
        "9FA0CAC93D077EAE61252557E02BBDD2F34BCDE6",
        "77EAE6125255BDD2F34BCDE69FA0CAC93D07E02B",
        "2F34BCDE69FA77EAE6125255BDD0CAC93D07E02B")
    .WithProductFeatures(new Dictionary<string, string>  
    {  
        {"Sales Module", "yes"},  
        {"Purchase Module", "yes"},  
        {"Maximum Transactions", "10000"}  
    })  
    .LicensedTo("John Doe", "john.doe@example.com")  
    .CreateAndSignWithPrivateKey(privateKey, passPhrase);
/// <summary>
/// Sets the allowed hardware ids of the <see cref="License"/>.
/// </summary>
/// <param name="hardwareIds">The valid hardware ids <see cref="License"/>.</param>
/// <returns>The <see cref="ILicenseBuilder"/>.</returns>
ILicenseBuilder WithHardwareIds(params string[] hardwareIds);

An additional WithCurrentHardwareIds could be interesting for locally signed certificates.

<!-- gh-comment-id:1443409699 --> @AntiGuideAkquinet commented on GitHub (Feb 24, 2023): I believe this would be an interesting feature to add the library. As recommended [saeidjoker/libc.hwid](https://github.com/saeidjoker/libc.hwid) could be used if we modify the targeted librarys as suggested in #20 I would suggest a generation caller syntax like: ```C# var license = License.New() .WithUniqueIdentifier(Guid.NewGuid()) .As(LicenseType.Trial) .ExpiresAt(DateTime.Now.AddDays(30)) .WithMaximumUtilization(5) .WithHardwareIds( "9FA0CAC93D077EAE61252557E02BBDD2F34BCDE6", "77EAE6125255BDD2F34BCDE69FA0CAC93D07E02B", "2F34BCDE69FA77EAE6125255BDD0CAC93D07E02B") .WithProductFeatures(new Dictionary<string, string> { {"Sales Module", "yes"}, {"Purchase Module", "yes"}, {"Maximum Transactions", "10000"} }) .LicensedTo("John Doe", "john.doe@example.com") .CreateAndSignWithPrivateKey(privateKey, passPhrase); ``` ```C# /// <summary> /// Sets the allowed hardware ids of the <see cref="License"/>. /// </summary> /// <param name="hardwareIds">The valid hardware ids <see cref="License"/>.</param> /// <returns>The <see cref="ILicenseBuilder"/>.</returns> ILicenseBuilder WithHardwareIds(params string[] hardwareIds); ``` An additional `WithCurrentHardwareIds` could be interesting for locally signed certificates.
Author
Owner

@mzayarnyuk commented on GitHub (Mar 16, 2023):

additional better pass if validates 2 from 4 ids, depends what PC parts user can replace someties;
other lic soft do that;
but most of id's is can be simulated with virtual enviroment;
additonal will good prevent app from run on virtualizatio OS, and additional checks to made work of hacker harder

<!-- gh-comment-id:1471656902 --> @mzayarnyuk commented on GitHub (Mar 16, 2023): additional better pass if validates 2 from 4 ids, depends what PC parts user can replace someties; other lic soft do that; but most of id's is can be simulated with virtual enviroment; additonal will good prevent app from run on virtualizatio OS, and additional checks to made work of hacker harder
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#18
No description provided.