Package rs.baselib.licensing.internal
Class RsaLicenseCreator
java.lang.Object
rs.baselib.licensing.internal.RsaLicenseCreator
- All Implemented Interfaces:
ILicenseCreator
public class RsaLicenseCreator extends java.lang.Object implements ILicenseCreator
Creates a full license.
- Author:
- ralph
-
Constructor Summary
Constructors Constructor Description RsaLicenseCreator()Constructor. -
Method Summary
Modifier and Type Method Description java.lang.StringcreateLicenseKey(ILicenseContext context, ILicense license)Generates a key from the given license.protected byte[]encrypt(ILicenseContext context, byte[] bytes)Encrypts the given bytes.
-
Constructor Details
-
RsaLicenseCreator
public RsaLicenseCreator()Constructor.
-
-
Method Details
-
createLicenseKey
Generates a key from the given license.- Specified by:
createLicenseKeyin interfaceILicenseCreator- Parameters:
context- the licensing context.license- the license to be created.- Returns:
- the license key
-
encrypt
protected byte[] encrypt(ILicenseContext context, byte[] bytes) throws java.security.GeneralSecurityException, java.io.IOExceptionEncrypts the given bytes.- Parameters:
context- the licensing contextbytes- the plain bytes- Returns:
- the bytes encrypted
- Throws:
java.io.IOException- when encryption failsjava.security.GeneralSecurityException- when cipher is invalid
-