Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to lock the generated license to only one computer? #18

Open
cmabox opened this issue Mar 27, 2021 · 3 comments
Open

How to lock the generated license to only one computer? #18

cmabox opened this issue Mar 27, 2021 · 3 comments

Comments

@cmabox
Copy link

cmabox commented Mar 27, 2021

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

@hiepgia
Copy link

hiepgia commented Apr 20, 2021

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

@AntiGuideAkquinet
Copy link
Contributor

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.

@mzayarnyuk
Copy link

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants