Class LicenseKey
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: SKMV3
Assembly: Cryptolens.Licensing.CrossPlatform.dll
Syntax
Properties
|
Improve this Doc
View Source
ActivatedMachines
Declaration
public List<ActivationData> ActivatedMachines { get; set; }
Property Value
|
Improve this Doc
View Source
AllowedMachines
Declaration
public string AllowedMachines { get; set; }
Property Value
|
Improve this Doc
View Source
Block
Declaration
public bool Block { get; set; }
Property Value
|
Improve this Doc
View Source
Created
Declaration
public DateTime Created { get; set; }
Property Value
|
Improve this Doc
View Source
Customer
Declaration
public Customer Customer { get; set; }
Property Value
|
Improve this Doc
View Source
DataObjects
Declaration
public List<DataObject> DataObjects { get; set; }
Property Value
|
Improve this Doc
View Source
Expires
Declaration
public DateTime Expires { get; set; }
Property Value
|
Improve this Doc
View Source
F1
Declaration
public bool F1 { get; set; }
Property Value
|
Improve this Doc
View Source
F2
Declaration
public bool F2 { get; set; }
Property Value
|
Improve this Doc
View Source
F3
Declaration
public bool F3 { get; set; }
Property Value
|
Improve this Doc
View Source
F4
Declaration
public bool F4 { get; set; }
Property Value
|
Improve this Doc
View Source
F5
Declaration
public bool F5 { get; set; }
Property Value
|
Improve this Doc
View Source
F6
Declaration
public bool F6 { get; set; }
Property Value
|
Improve this Doc
View Source
F7
Declaration
public bool F7 { get; set; }
Property Value
|
Improve this Doc
View Source
F8
Declaration
public bool F8 { get; set; }
Property Value
|
Improve this Doc
View Source
GlobalId
Declaration
public long GlobalId { get; set; }
Property Value
|
Improve this Doc
View Source
ID
Declaration
public int ID { get; set; }
Property Value
|
Improve this Doc
View Source
Key
Declaration
public string Key { get; set; }
Property Value
|
Improve this Doc
View Source
MaxNoOfMachines
Declaration
public int MaxNoOfMachines { get; set; }
Property Value
|
Improve this Doc
View Source
Notes
Declaration
public string Notes { get; set; }
Property Value
|
Improve this Doc
View Source
Period
Declaration
public int Period { get; set; }
Property Value
|
Improve this Doc
View Source
ProductId
Declaration
public int ProductId { get; set; }
Property Value
|
Improve this Doc
View Source
RawResponse
Declaration
public RawResponse RawResponse { get; set; }
Property Value
|
Improve this Doc
View Source
Reseller
Declaration
public Reseller Reseller { get; set; }
Property Value
|
Improve this Doc
View Source
SignDate
Declaration
public DateTime SignDate { get; set; }
Property Value
|
Improve this Doc
View Source
Signature
Declaration
public string Signature { get; set; }
Property Value
|
Improve this Doc
View Source
TrialActivation
Declaration
public bool TrialActivation { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
AddDataObject(string, DataObject)
Declaration
public long AddDataObject(string token, DataObject dataObject)
Parameters
Returns
Type |
Description |
long |
Returns the id of the data object (and updates the DataObjects) if successful, or -1 otherwise.
|
|
Improve this Doc
View Source
AddFeature(string, int)
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");
Declaration
public bool AddFeature(string token, int feature)
Parameters
Returns
Type |
Description |
bool |
Returns a true if successful and false otherwise.
|
Exceptions
|
Improve this Doc
View Source
DaysLeft(bool)
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.
Declaration
public int DaysLeft(bool zeroIfExpired = false)
Parameters
Type |
Name |
Description |
bool |
zeroIfExpired |
If true, when a license has expired, zero will be returned.
|
Returns
|
Improve this Doc
View Source
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
object |
obj |
The object to compare with the current object.
|
Returns
Type |
Description |
bool |
true if the specified object is equal to the current object; otherwise, false.
|
Overrides
|
Improve this Doc
View Source
FromResponse(string, RawResponse)
Creates a license key from a RawResponse object that can be obtained when calling
Key.Activate(string, int, string, string, bool, int, int).
Declaration
public static LicenseKey FromResponse(string RSAPubKey, RawResponse response)
Parameters
Returns
|
Improve this Doc
View Source
Refresh(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, bool), and setting the second parameter to 'true'.
Declaration
public bool Refresh(string token)
Parameters
Returns
Type |
Description |
bool |
Returns true if successful or false otherwise.
|
|
Improve this Doc
View Source
Refresh(string, bool)
Gets the new version of this license from SKM.
Declaration
public bool Refresh(string token, bool sign)
Parameters
Returns
Type |
Description |
bool |
Returns true if successful or false otherwise.
|
|
Improve this Doc
View Source
RemoveDataObject(string, int)
This method will remove an existing data object.
Declaration
public bool RemoveDataObject(string token, int dataObjectId)
Parameters
Returns
Type |
Description |
bool |
Returns true if successful or false otherwise.
|
Extension Methods