|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.smardec.license4j.LicenseManager
The main class for managing licenses.
Constructor Summary | |
LicenseManager()
|
Method Summary | |
static boolean |
isValid(License license)
Indicates whether license is valid. |
static License |
loadLicense(java.io.InputStream stream)
Loads license from the specified stream. |
static License |
loadLicense(java.lang.String filename)
Loads license from the specified file. |
static void |
saveLicense(License license,
java.lang.String filename)
Saves the license to the specified file. |
static void |
setPrivateKey(java.lang.String key)
Sets private key. |
static void |
setPublicKey(java.lang.String key)
Sets public key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LicenseManager()
Method Detail |
public static void setPrivateKey(java.lang.String key)
key
- private keypublic static void setPublicKey(java.lang.String key)
key
- public keypublic static License loadLicense(java.lang.String filename) throws LicenseNotFoundException
filename
- name of the file
License
object
LicenseNotFoundException
- if the license can not be readpublic static License loadLicense(java.io.InputStream stream) throws LicenseNotFoundException
stream
- stream containing license information
License
object
LicenseNotFoundException
- if the license can not be readpublic static void saveLicense(License license, java.lang.String filename) throws java.security.GeneralSecurityException, java.lang.IllegalArgumentException, java.io.IOException
license
- License
object to writefilename
- name of the file
java.security.GeneralSecurityException
- if private key is not initialized by setPrivateKey(String)
java.lang.IllegalArgumentException
- if license has no features
java.io.IOException
- if the specified file exists but is a directory rather
than a regular file, does not exist but cannot be
created, or cannot be opened for any other reasonpublic static boolean isValid(License license) throws java.security.GeneralSecurityException
license
- license to check
true
if the license is valid
false
otherwise
java.security.GeneralSecurityException
- if public key is not initialized by setPublicKey(String)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |