-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
import java.text.SimpleDateFormat; | ||
import java.util.Calendar; | ||
import java.util.Date; | ||
import java.util.GregorianCalendar; | ||
|
||
public class LicenseUtil { | ||
|
||
|
@@ -54,6 +55,7 @@ public static boolean isValid(String license) { | |
|
||
/** | ||
* returns the license expiration | ||
* | ||
* @param license encrypted license string | ||
* @return license expiration | ||
*/ | ||
|
@@ -70,4 +72,19 @@ public static String getExpirationDt(String license) { | |
} | ||
return null; | ||
} | ||
|
||
/** | ||
* returns the license for running in ec2 | ||
* | ||
* @return license text | ||
*/ | ||
public static String generateForEC2() { | ||
Calendar cal = new GregorianCalendar(); | ||
cal.add(Calendar.YEAR, 50); | ||
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy"); | ||
|
||
return EncryptionUtil.encrypt(k, "[email protected]" + sdf.format(cal.getTime())); | ||
|
||
} | ||
|
||
} |