Package com.itextpdf.licensing.base
Class LicenseKey
java.lang.Object
com.itextpdf.licensing.base.LicenseKey
An entry point for license files management.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LicenseInfo
getLoadedLicenseInfo
(String productName) Gets info about loaded license for provided product name, trying to update the license.static LicenseInfo
getLoadedLicenseInfo
(String productName, boolean checkingForUpdates) Gets info about loaded license for provided product name.static List<LicenseInfo>
Gets info about loaded licenses.static void
static void
loadLicenseFile
(File licenseFile) Loads a license file or array of licenses from aFile
.static void
loadLicenseFile
(InputStream licenseIs) Loads a license file or array of licenses using anInputStream
.static void
unloadLicenseForProduct
(String productName) Unloads license for specific product.static void
Unload all licenses for all products.
-
Method Details
-
initialize
public static void initialize() -
unloadLicenses
public static void unloadLicenses()Unload all licenses for all products. -
unloadLicenseForProduct
Unloads license for specific product.- Parameters:
-
productName
- the name of the product for which license will be unloaded
-
loadLicenseFile
Loads a license file or array of licenses from aFile
. It is expected that file contains license as json object or json array of such licenses. The certificate is read from the jar.Note that method does not perform any additional checks and does not consider license files loading as a transaction. If any error occurs, on loading array of licenses method execution will be stopped but already loaded licenses will not be unloaded.
- Parameters:
-
licenseFile
- the file to load license - Throws:
-
LicenseKeyException
- thrown if there's a problem with the license file
-
loadLicenseFile
Loads a license file or array of licenses using anInputStream
. It is expected that input stream contains license as json object or json array of such licenses. The certificate is read from the jar.Note that method does not perform any additional checks and does not consider license files loading as a transaction. If any error occurs, on loading array of licenses method execution will be stopped but already loaded licenses will not be unloaded.
- Parameters:
-
licenseIs
- the input stream for load license - Throws:
-
LicenseKeyException
- thrown if there's a problem with the license file
-
getLoadedLicensesInfo
Gets info about loaded licenses.- Returns:
- list with loaded license info, or empty list if there is no licenses
-
getLoadedLicenseInfo
Gets info about loaded license for provided product name.- Parameters:
-
productName
- the product name -
checkingForUpdates
- flag that specifies if updates need to be checked - Returns:
-
the loaded license info which corresponds to the passed product name, or
null
if there is no license
-
getLoadedLicenseInfo
Gets info about loaded license for provided product name, trying to update the license.- Parameters:
-
productName
- the product name - Returns:
-
the loaded license info which corresponds to the passed product name, or
null
if there is no license
-