Package io.mosip.kernel.lkeymanager.util
Class LicenseKeyManagerUtil
java.lang.Object
io.mosip.kernel.lkeymanager.util.LicenseKeyManagerUtil
This class provides several utility methods to be used in license key manager
service.
- Since:
- 1.0.0
- Author:
- Sagar Mahapatra
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareValidPermissions(List<String> inputPermissions) This method validates whether the input permissions are from the master list or not.concatPermissionsIntoASingleRow(List<String> permissionsList) This method adds all the permissions into a single row separated by comma.Method that generates a random license key of specified length.Method that returns the current date-time in UTC time zone.voidvalidateRequestParameters(String tspID, String licenseKey, List<String> permissions) Method to validate TSP ID, License Key, and the list of permissions.voidvalidateTSP(String tspID) Method to validate TSP ID.voidvalidateTSPAndLicenseKey(String tspID, String licenseKey) Method to validate TSP ID and License Key.
-
Constructor Details
-
LicenseKeyManagerUtil
public LicenseKeyManagerUtil()
-
-
Method Details
-
concatPermissionsIntoASingleRow
This method adds all the permissions into a single row separated by comma.- Parameters:
permissionsList- the list of permissions.- Returns:
- the resultant string.
-
areValidPermissions
This method validates whether the input permissions are from the master list or not.- Parameters:
inputPermissions- the list of input permissions.- Returns:
- true if all the input permissions are valid.
-
getCurrentTimeInUTCTimeZone
Method that returns the current date-time in UTC time zone.- Returns:
- the local date time as specified.
-
generateLicense
Method that generates a random license key of specified length.- Returns:
- the generated license key.
-
validateTSP
Method to validate TSP ID.- Parameters:
tspID- the TSP ID to be validated.
-
validateTSPAndLicenseKey
Method to validate TSP ID and License Key.- Parameters:
tspID- the TSP ID to be validated.licenseKey- the license key to be validated.
-
validateRequestParameters
Method to validate TSP ID, License Key, and the list of permissions.- Parameters:
tspID- the TSP ID.licenseKey- the license Key.permissions- the list of permissions.
-