Click or drag to resize

LicenseKey Class

This class describes a License Key object. You can use it to verify a license, store it in a file, or use some of its methods to update it.
Inheritance Hierarchy
SystemObject
  SKM.V3LicenseKey

Namespace:  SKM.V3
Assembly:  SKM (in SKM.dll) Version: 4.0.2.6 (4.0.2.6)
Syntax
public class LicenseKey

The LicenseKey type exposes the following members.

Constructors
  NameDescription
Public methodLicenseKey
Initializes a new instance of the LicenseKey class
Top
Properties
Methods
  NameDescription
Public methodAddDataObject
Creates a new DataObject.
Public methodAddFeature
Gets the new version of this license from SKM. Note, you need to manually assign the new value to this object, eg, by license = license.Refresh("token");
Public methodDaysLeft
Returns the number of days left for a given license (time left). This method is particularly useful when KeyInfo is not updated regularly, because TimeLeft will not be affected (stay constant). If your implementation checks the license with the server periodically, this method should be used instead of TimeLeft.
Public methodDaysLeft(Boolean)
Returns the number of days left for a given license (time left). This method is particularly useful when KeyInfo is not updated regularly, because TimeLeft will not be affected (stay constant). If your implementation checks the license with the server periodically, this method should be used instead of TimeLeft.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRefresh(String)
Gets the new version of this license from SKM. By default, if the Signature field ís not null and not empty, SKM will sign the new data too. You can also require this explicitly by calling Refresh(String, Boolean), and setting the second parameter to 'true'.
Public methodRefresh(String, Boolean)
Gets the new version of this license from SKM.
Public methodRemoveDataObject
This method will remove an existing data object.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodHasFeature
Checks so that a certain Feature is enabled (i.e. it's set to TRUE).
(Defined by ExtensionMethods.)
Public Extension MethodHasNotExpired
Checks that they key has not expired (i.e. the expire date has not been reached).
(Defined by ExtensionMethods.)
Public Extension MethodHasNotFeature
Checks so that a certain Feature is disabled (i.e. it's set to FALSE).
(Defined by ExtensionMethods.)
Public Extension MethodHasValidSignature(String)Overloaded.
Checks that this object has a valid signature, which means that the content has not been altered after that it was generated by Serial Key Manager.
(Defined by ExtensionMethods.)
Public Extension MethodHasValidSignature(String, NullableInt32)Overloaded.
Checks that this object has a valid signature, which means that the content has not been altered after that it was generated by Serial Key Manager.
(Defined by ExtensionMethods.)
Public Extension MethodIsBlocked
Checks so that a they key is blocked.
(Defined by ExtensionMethods.)
Public Extension MethodIsNotBlocked
Checks so that a they key is not blocked.
(Defined by ExtensionMethods.)
Public Extension MethodIsOnRightMachineOverloaded.
Checks so that the machine code corresponds to the machine code of this computer. The default hash function is SHA1.
(Defined by ExtensionMethods.)
Public Extension MethodIsOnRightMachine(FuncString, String)Overloaded.
Checks so that the machine code corresponds to the machine code of this computer.
(Defined by ExtensionMethods.)
Public Extension MethodIsValidOverloaded.
Checks that the Key Information object is valid (in the correct format). You can always add constraints such as @HasNotExpired(LicenseKey, Boolean).
(Defined by ExtensionMethods.)
Public Extension MethodIsValid(String)Overloaded.
Checks that the Key Information object is valid (in the correct format). You can always add constraints such as @HasNotExpired(LicenseKey, Boolean).
It will also check if the license key file has been modified by an unauthorized person. This method will only return true if the license key information is exactly the same as the one that was provided and signed by SKM.
(Defined by ExtensionMethods.)
Public Extension MethodLoadFromFileOverloaded.
Loads the LicenseKey object from a file.
(Defined by ExtensionMethods.)
Public Extension MethodLoadFromFile(String)Overloaded.
Loads the LicenseKey object from a file.
(Defined by ExtensionMethods.)
Public Extension MethodSaveToFileOverloaded.
Saves the current LicenseKey object to file.
(Defined by ExtensionMethods.)
Public Extension MethodSaveToFile(String)Overloaded.
Saves the current LicenseKey object to file.
(Defined by ExtensionMethods.)
Top
Remarks
You can use the
feature lock
to choose which fields should be masked. On the activation method page, you can use the interactive table to choose which fields should be masked. FieldsToReturn will then get a new value, and this value should then be used in the
feature lock
.
See Also