Skip to main content
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. Namespace: SKM.V3
Version: 4.0.54. Both packages; all six documented target frameworks.
Web API Reference

Properties

ActivatedMachines

Activated devices/machines that belong to this license key.
Type: List of ActivationData

AllowedMachines

Machine codes of those devices that will be prioritized during activation. Even if the limit is achieved, these will still be activated.
Type: string

Block

Whether this license is blocked. A successful GetKey response can contain a blocked license.
Type: bool

Created

The creation date of the license key.
Type: DateTime

Customer

The entire customer object assigned to this license key.
Type: Customer

DataObjects

A list of Data objects, additional variables associated with the license key.
Type: List of DataObject

Expires

The license expiry date. Enforce it according to your application’s licensing policy; API success alone does not check it.
Type: DateTime

F1

The feature 1 of the license key.
Type: bool

F2

The feature 2 of the license key.
Type: bool

F3

The feature 3 of the license key.
Type: bool

F4

The feature 4 of the license key.
Type: bool

F5

The feature 5 of the license key.
Type: bool

F6

The feature 6 of the license key.
Type: bool

F7

The feature 7 of the license key.
Type: bool

F8

The feature 8 of the license key.
Type: bool

GlobalId

A unique identifier of the license key. It can, for instance, be used as a “ReferencerId” when creating a data object(aka additional variables).
Type: long

ID

The ID (within the product) of the license key.
Type: int

Key

The license key string, eg. ABCDE-EFGHI-JKLMO-PQRST.
Type: string

MaxNoOfMachines

The maximum number of machines/devices that may activate this license. By setting this to 0, machine locking will be disabled and an unlimited number of devices will be able to activate the license.
Type: int

Notes

The notes field of the license key.
Type: string

Period

The duration of current license cycle eg. 30 days. Note, this is a static number and does not change automatically.
Type: int

ProductId

The ID of the product that this key belongs to.
Type: int

RawResponse

The original signed RawResponse, when the object was created from that format. SaveAsString preserves this response.
Type: RawResponse

Reseller

The reseller assigned to the license, when returned. FromResponse does not copy this field in 4.0.54.
Type: Reseller

SignDate

The signed response timestamp. Offline age checks use this time; saving the file again does not update it.
Type: DateTime

Signature

The signature used by the serialized-LicenseKey signing format. For objects created by FromResponse, the signature is held in RawResponse instead.
Type: string

TrialActivation

Tells if trial activation is enabled.
Type: bool

Constructors

LicenseKey()

Creates an empty LicenseKey object. This constructor does not send an API request.

Methods

AddDataObject(string, DataObject)

Creates a new DataObject.
Parameters Returns: long. Returns the id of the data object (and updates the DataObjects) if successful, or -1 otherwise. Note: for more details, please see AddDataObject

AddFeature(string, int)

Enables a numbered feature through the API and updates the matching local F1–F8 property.
Parameters Returns: bool. True after a successful API result; false otherwise. Failure Behavior: Throws ArgumentException when feature is outside 1 through 8. The access token needs the AddFeature permission. Updating the object does not create a new signed response.

DaysLeft(bool)

Calculates the number of days until the license expiry date.
Parameters Returns: int. Days until Expires, rounded upward. With zeroIfExpired=true, negative values are replaced by zero. Checks: Uses DateTime.UtcNow; does not verify the signature or decide whether the application may run.

Equals(object)

Compares this object with another object using this type’s equality implementation.
Parameters Returns: bool. True when the compared fields match; otherwise false. This is not a signature or license-validity check. Checks: This comparison is not signature verification or license validation.

FromResponse(string, RawResponse)

Verifies and decodes a signed RawResponse.
Parameters Returns: LicenseKey. A new LicenseKey with its RawResponse attached. Returns null for a null/error response or failed RSA signature verification. Checks: Verifies the license payload signature using the supplied RSA public key. It does not enforce expiry, blocking, machine binding, features or cache age, and does not verify metadata. Failure Behavior: Malformed Base64 or decoded license JSON can throw; those conversions are outside the signature-verification catch. In 4.0.54, this conversion does not copy Reseller, ActivationData.FriendlyName or ActivationData.FloatingExpires into the parsed license. The original signed response remains in RawResponse.

Refresh(string)

Retrieves updated license data using GetKey and copies fields into this object.
Parameters Returns: bool. True when GetKey succeeds and the fields are updated; false for a failed result. Checks: Does not verify the new signature and does not renew a floating seat. The access token needs the GetKey permission. The overload without sign requests signing only when the existing Signature string is non-empty. In 4.0.54, Refresh does not replace an attached RawResponse; load a freshly verified response instead when using that format.

Refresh(string, bool)

Retrieves updated license data using GetKey and copies fields into this object.
Parameters Returns: bool. True when GetKey succeeds and the fields are updated; false for a failed result. Checks: Does not verify the new signature and does not renew a floating seat. The access token needs the GetKey permission. The overload without sign requests signing only when the existing Signature string is non-empty. In 4.0.54, Refresh does not replace an attached RawResponse; load a freshly verified response instead when using that format.

RemoveDataObject(string, int)

This method will remove an existing data object.
Parameters Returns: bool. Returns true if successful or false otherwise. Uses the RemoveDataObject API for this license. The access token needs the RemoveDataObject permission; a successful call also updates the local DataObjects list.

FAQ

In 4.0.54, FromResponse does not copy Reseller, ActivatedMachines[].FriendlyName or ActivatedMachines[].FloatingExpires into the resulting object. The original response remains in RawResponse. Do not assume these fields are absent on the server because the converted object has no value.
Be careful with objects created by FromResponse: Refresh changes the object’s fields but does not replace its stored RawResponse. SaveAsString prefers that stored response, so it can save the older data. Retrieve a new signed response, verify it and save the newly returned object instead.
.NET SDK Reference · Reviewed Source Revision