Class LicenseKey
java.lang.Object
io.cryptolens.models.LicenseKey
Represents a license returned by Key.Activate.
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
long
long
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
long
long
int
int
int
protected String
Internal variable used to store the response.long
boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the current license has expired.boolean
HasFeature
(int feature) Check if this license has a certain feature enabled (i.e.boolean
Check if the current license has not expired.static LicenseKey
LoadFromString
(String RSAPubKey, String licenseString) Load a license string (created with @see SaveAsString) into a license object.static LicenseKey
LoadFromString
(String RSAPubKey, String licenseString, int signatureExpirationInterval) Load a license string (created with @see SaveAsString) into a license object.Save the current license object as a string.
-
Field Details
-
ProductId
public int ProductId -
Id
public long Id -
Key
-
Created
public long Created -
Expires
public long Expires -
Period
public int Period -
F1
public boolean F1 -
F2
public boolean F2 -
F3
public boolean F3 -
F4
public boolean F4 -
F5
public boolean F5 -
F6
public boolean F6 -
F7
public boolean F7 -
F8
public boolean F8 -
Notes
-
Block
public boolean Block -
GlobalId
public long GlobalId -
Customer
-
ActivatedMachines
-
TrialActivation
public boolean TrialActivation -
MaxNoOfMachines
public int MaxNoOfMachines -
DataObjects
-
Reseller
-
SignDate
public long SignDate -
RawResponse
Internal variable used to store the response.
-
-
Constructor Details
-
LicenseKey
public LicenseKey()
-
-
Method Details
-
SaveAsString
Save the current license object as a string. You can load it again using @see LoadFromString.- Returns:
- A string representing this license object object.
-
LoadFromString
Load a license string (created with @see SaveAsString) into a license object. Note, signature verification will be performed under the hood.- Parameters:
RSAPubKey
- Your RSA Public Key, which can be found here.licenseString
- The license key object stored as a string.- Returns:
- A license key object from the 'licenseString'.
-
LoadFromString
public static LicenseKey LoadFromString(String RSAPubKey, String licenseString, int signatureExpirationInterval) Load a license string (created with @see SaveAsString) into a license object. Note, signature verification will be performed under the hood.- Parameters:
RSAPubKey
- Your RSA Public Key, which can be found here.licenseString
- The license key object stored as a string.signatureExpirationInterval
- If the license key was signed, this method will check so that no more than "signatureExpirationInterval" days have passed since the last activation.- Returns:
- A new license key object or null (if an error has occurred).
-
HasExpired
public boolean HasExpired()Check if the current license has expired.- Returns:
- True if it has expired and false otherwise.
-
HasNotExpired
public boolean HasNotExpired()Check if the current license has not expired.- Returns:
- True if it has not expired and false otherwise.
-
HasFeature
public boolean HasFeature(int feature) Check if this license has a certain feature enabled (i.e. set to true).- Parameters:
feature
- The feature, eg 1 to 8.- Returns:
- If the feature is set to true, true is returned and false otherwise.
-