|
|||||||
| 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.
| Method Summary | |
static boolean |
isSerializeStrings()
Indicates whether String feature values
will be stored in the license in the serialized form. |
static boolean |
isValid(License license)
Indicates whether the license is valid. |
static License |
loadLicense(java.io.InputStream stream)
Loads license from the specified InputStream. |
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 |
saveLicense(License license,
java.io.Writer writer)
Saves the license to the specified Writer. |
static void |
setPrivateKey(java.lang.String key)
Sets private key. |
static void |
setPublicKey(java.lang.String key)
Sets public key. |
static void |
setSerializeStrings(boolean serializeStrings)
Specifies whether String feature values
will be stored in the license in the serialized form. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean isSerializeStrings()
String feature values
will be stored in the license in the serialized form.
If true than String objects will be serialized.
The default is false.
true if String objects will be serialized,
false otherwise. The default is false.public static void setSerializeStrings(boolean serializeStrings)
String feature values
will be stored in the license in the serialized form.
If true than String objects will be serialized.
The default is false.
serializeStrings - true if String objects should be serialized,
false otherwise. The default is falsepublic static void setPrivateKey(java.lang.String key)
key - private keypublic static void setPublicKey(java.lang.String key)
key - public key
public static License loadLicense(java.lang.String filename)
throws LicenseNotFoundException
filename - name of the license file
License object.
LicenseNotFoundException - if the license cannot be read
public static License loadLicense(java.io.InputStream stream)
throws LicenseNotFoundException
InputStream.
stream - InputStream that contains license information
License object.
LicenseNotFoundException - if the license cannot be read
public 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 reason
public static void saveLicense(License license,
java.io.Writer writer)
throws java.security.GeneralSecurityException,
java.lang.IllegalArgumentException,
java.io.IOException
Writer.
Note that Writer.close() method is not invoked after writing the license.
license - License object to writewriter - Writer object
java.security.GeneralSecurityException - if private key is not initialized by setPrivateKey(String)
java.lang.IllegalArgumentException - if license has no features
java.io.IOException - if an I/O error occurs
public 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 | ||||||