Class LicenseKey

java.lang.Object
io.cryptolens.models.LicenseKey

public class LicenseKey extends Object
Represents a license returned by Key.Activate.
  • Field Details

    • ProductId

      public int ProductId
    • Id

      public long Id
    • Key

      public String 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

      public String Notes
    • Block

      public boolean Block
    • GlobalId

      public long GlobalId
    • Customer

      public Customer Customer
    • ActivatedMachines

      public List<ActivatedMachine> ActivatedMachines
    • TrialActivation

      public boolean TrialActivation
    • MaxNoOfMachines

      public int MaxNoOfMachines
    • DataObjects

      public List<DataObject> DataObjects
    • Reseller

      public Reseller Reseller
    • SignDate

      public long SignDate
    • RawResponse

      protected String RawResponse
      Internal variable used to store the response.
  • Constructor Details

    • LicenseKey

      public LicenseKey()
  • Method Details

    • SaveAsString

      public String 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

      public static LicenseKey LoadFromString(String RSAPubKey, String licenseString)
      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.