public final class LicenseCreator extends Object
LicenseCreatorProperties. The values in this class will be used to instantiate the license creator.
After setting all the necessary properties there, one can retrieve an instance using getInstance(). Be
sure to set all the properties first; once getInstance() is called for the first time, any changes to
LicenseCreatorProperties will be ignored.| Modifier and Type | Method and Description |
|---|---|
static LicenseCreator |
getInstance()
Returns the license creator instance.
|
byte[] |
signAndSerializeLicense(License license)
Takes a license object and creates a secure and serialized version of it for delivery to the customer.
|
byte[] |
signAndSerializeLicense(License license,
char[] licensePassword)
Takes a license object and creates a secure and serialized version of it for delivery to the customer.
|
SignedLicense |
signLicense(License license)
Takes a license object and creates a secure version of it for serialization and delivery to the customer.
|
SignedLicense |
signLicense(License license,
char[] licensePassword)
Takes a license object and creates a secure version of it for serialization and delivery to the customer.
|
public static LicenseCreator getInstance()
LicenseCreatorProperties. See the documentation for that class for more details.IllegalArgumentException - if privateKeyDataProvider or privateKeyPasswordProvider are nullpublic final SignedLicense signLicense(License license, char[] licensePassword) throws AlgorithmNotSupportedException, KeyNotFoundException, InappropriateKeySpecificationException, InappropriateKeyException
license - The license object to be signedlicensePassword - The password to encrypt the license withAlgorithmNotSupportedException - if the encryption algorithm is not supported.KeyNotFoundException - if the public key data could not be found.InappropriateKeySpecificationException - if an inappropriate key specification is provided.InappropriateKeyException - if the key type and cipher type do not match.public final SignedLicense signLicense(License license) throws AlgorithmNotSupportedException, KeyNotFoundException, InappropriateKeySpecificationException, InappropriateKeyException
license - The license object to be signedAlgorithmNotSupportedException - if the encryption algorithm is not supported.KeyNotFoundException - if the public key data could not be found.InappropriateKeySpecificationException - if an inappropriate key specification is provided.InappropriateKeyException - if the key type and cipher type do not match.public final byte[] signAndSerializeLicense(License license, char[] licensePassword) throws AlgorithmNotSupportedException, KeyNotFoundException, InappropriateKeySpecificationException, InappropriateKeyException, ObjectSerializationException
license - The license object to be signed and serializedlicensePassword - The password to encrypt the license withAlgorithmNotSupportedException - if the encryption algorithm is not supported.KeyNotFoundException - if the public key data could not be found.InappropriateKeySpecificationException - if an inappropriate key specification is provided.InappropriateKeyException - if the key type and cipher type do not match.ObjectSerializationException - if an error is encountered while serializing the key.public final byte[] signAndSerializeLicense(License license) throws AlgorithmNotSupportedException, KeyNotFoundException, InappropriateKeySpecificationException, InappropriateKeyException, ObjectSerializationException
license - The license object to be signed and serializedAlgorithmNotSupportedException - if the encryption algorithm is not supported.KeyNotFoundException - if the public key data could not be found.InappropriateKeySpecificationException - if an inappropriate key specification is provided.InappropriateKeyException - if the key type and cipher type do not match.ObjectSerializationException - if an error is encountered while serializing the key.Copyright © 2010-2013 NWTS Java Code. All Rights Reserved. Licensed Under the Apache License version 2.0.