HardwareId
Namespace: Babel.Licensing Assembly: Babel.Licensing.dll
A hardware identifier.
Inheritance
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
HardwareId()
Initializes a new instance of the class.
Examples
HardwareId(HardwareComponents)
Initializes a new instance of the class with the specified hardware components.
Parameters
The hardware components used to generate the machine key.
Examples
HardwareId(HardwareComponents, byte[])
Initializes a new instance of the class with the specified hardware components and salt byte array to seed the key.
Parameters
The hardware components used to generate the machine key.
A value used to seed the generated key.
Examples
This example shows how to create an hardware key with two bytes random salt.
Properties
RequiredComponents
Gets or sets the hardware components required to generate the hardware key identifier.
Property Value
Salt
Gets or sets the seed used to generate the key.
Property Value
byte[]
Methods
Create()
Creates a hardware key using the best available hardware components.
Returns
The HardwareId object with avaialble hardware components.
Remarks
Using the system name as the basis for generating a hardware key for license validation can be risky. The system name is typically a user-configurable setting and can be easily changed by the user, potentially leading to unauthorized access or abuse of the license system. Additionally, system names are not guaranteed to be unique, and different systems may have the same name, resulting in conflicts and inaccuracies in license validation. On the other hand, using hardware information such as Ethernet card MAC addresses can provide a more robust and unique basis for generating a hardware key.MAC addresses are assigned to network interface cards by the manufacturer and are globally unique, meaning that the likelihood of conflicts or inaccuracies is significantly reduced compared to using system names. However, it's important to note that MAC addresses can also be spoofed or manipulated in some cases. In general, it is recommended to use multiple hardware information points to create a hardware key for license validation, rather than relying solely on a single parameter like system name or MAC address. This can help increase the accuracy and security of license validation, and reduce the risks associated with potential conflicts or unauthorized access.
IsValid(string)
Query if 'key' is valid.
Parameters
The key.
Returns
true if valid, false if not.
Exceptions
Thrown when one or more required arguments are null.
Thrown when one or more arguments have unsupported or illegal values.
ToMachineKey(int)
Converts this object to a machine key.
Parameters
(Optional) Size of the readable token.
Returns
A string that represents the hardware components.
Exceptions
Thrown when one or more arguments have unsupported or illegal values.
Last updated