You can create a unique hash by PC name, hardware information, etc. and add this hash as an Additional Attribute during license creation.
Example of creating a license:
var license = License.New() .WithUniqueIdentifier(Guid.NewGuid()) .As(LicenseType.Standard) .WithMaximumUtilization(1) .WithAdditionalAttributes(new Dictionary<string, string> { {"HardwareId", "........"} }) .LicensedTo("John Doe", " john.doe@yourmail.here ") .CreateAndSignWithPrivateKey(privateKey, passPhrase);
To test an attribute, you can implement your own validation extension method or just use the existing AssertThat() . Example: [1]
Generating a unique hardware identifier goes beyond portable licensing.
[1] https://github.com/dnauck/Portable.Licensing/blob/develop/src/Portable.Licensing/Validation/LicenseValidationExtensions.cs#L100
source share