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.String createLicenseKey​(ILicenseContext context, ILicense license)
    Generates a key from the given license.
    protected byte[] encrypt​(ILicenseContext context, byte[] bytes)
    Encrypts the given bytes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • createLicenseKey

      public java.lang.String createLicenseKey​(ILicenseContext context, ILicense license)
      Generates a key from the given license.
      Specified by:
      createLicenseKey in interface ILicenseCreator
      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.IOException
      Encrypts the given bytes.
      Parameters:
      context - the licensing context
      bytes - the plain bytes
      Returns:
      the bytes encrypted
      Throws:
      java.io.IOException - when encryption fails
      java.security.GeneralSecurityException - when cipher is invalid