SDKs
...
Licensing Scenarios
License Type Options
Time-Limited
10min
in this guide, you'll learn how to manage time limited licenses using the licensespring sdks this includes understanding validity periods, detecting license expiry with methods like "isexpired," implementing local checks, and gaining insights into remaining days for effective software access management by mastering these strategies, you can enhance your software distribution through precise time based licensing techniques prerequisites completed the getting started docid\ lsfy9tq3vfq4roow9shkd tutorial, including initialized licensemanager (or licensehandler ) with your configuration using the appropriate settings created a licenseid using either licenseid fromkey or licenseid fromuser function, depending on the activation method you prefer activated a license of any type interpreting and retrieving validity period upon configuring a new product in licensespring, you gain the ability to set the default validity period for generated license keys this validity period signifies the duration in days between the initial activation of the license key and its expiration note a license key can be configured for perpetual validity or restricted within a specific time frame retrieving validity period in local time with our sdk, obtaining the validity period of a license key in your local time zone becomes a seamless process the validity period is stored within the license object and can be accessed by using the following method tm licensespring license validityperiod()datetime licensespring license validityperiod() licensedata licensedatabuilder validityperiod( zoneddatetime validityperiod )license validityperiod // date? retrieving validity period in utc developers also have the ability to get the validity period in utc, rather than local time this is done with the following tm licensespring license validityperiodutc() datetime licensespring license validityperiodutc() license validity period() how to verify if a license has expired by employing our system, you can easily determine whether a license has expired or remains valid this process empowers you with accurate information to manage software access effectively, ensuring a seamless user experience utilizing the "isexpired" method to check license expiry the isexpired() method provides an efficient way to check whether a license has reached its expiration date our sdks offer the ability to check the expiration status through the use of the following license methods bool licensespring license isexpired()bool licensespring license isexpired() boolean isexpired()license isexpiredlicense is expired() note our java sdk's isexpired() method is called on the licensedata object implementing local checks for license expiry a local license check involves assessing the validity and expiration status of a software license within the immediate operating environment by performing checks locally, the software verifies the license's authenticity and expiration status without relying on external connections if the local license is expired, the sdks will throw the following exceptions licensestateexceptionlicenseexpiredexceptionlicenseexpiredexceptionlicensestateexception see license checks docid\ ie dah13b4dqxmaqoygrj for more information about local license checks understanding the "days remaining" value developers can also access a field within the license object that holds the number of days remiaining until the license expires this number of days can be retrieved using the following methods, in the current time zone and utc, respectively int licensespring license daysremaining() int licensespring license daysremainingutc()int licensespring license daysremaining()	 int licensespring license daysremainingutc() long daysremaining()license days remaining() note the java sdk only offers the ability to retrieve the days remaining in the current time zone