com.license4j

## Class LicenseManager

- java.lang.Object
- - com.license4j.LicenseManager

-     public class LicenseManager
      extends java.lang.Object

  LicenseManager is used to create key pair and a license. DSA, RSA and EC algorithms are supported and all supported key pair and signature algorithms and key sizes are statically defined in LicenseManager class and they should be used.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LicenseManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static LicenseKeyPair` | `createKeyPair(java.lang.String name, java.lang.String description, java.lang.String keypairAlgorithm, java.lang.String signatureAlgorithm, int keysize)` Creates and returns new LicenseKeyPair object which includes public and private keys.
    `static java.lang.String` | `generateLicenseKey(LicenseKeyPair keypair, LicenseKey licenseKeyObject)` Generates cryptographically secure license key from given license key object and key pair.
    `static java.lang.String` | `generateLicenseKey(java.lang.String publickey, LicenseKey licenseKeyObject)` Generates basic license key from given license key object and public key.
    `static java.lang.String` | `generateLicenseText(LicenseKeyPair keypair, LicenseText licenseTextObject)` Generates license text from given license text object and key pair.
    `static java.lang.String` | `getLibraryVersion()` License4J library version info.
    `static LicenseKeyPair` | `loadKeyPair(java.lang.String keypairString)` Loads key pair.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LicenseManager

          public LicenseManager()

  - ### Method Detail

    - #### createKeyPair

          public static LicenseKeyPair createKeyPair(java.lang.String name,
                                     java.lang.String description,
                                     java.lang.String keypairAlgorithm,
                                     java.lang.String signatureAlgorithm,
                                     int keysize)
                                              throws LicenseSecurityException

      Creates and returns new LicenseKeyPair object which includes public and private keys.
      Parameters:
        `name` - key pair descriptive name
        `description` - description
        `keypairAlgorithm` - one of the key pair algorithms below
        - `LicenseKeyPair.KEYPAIR_ALGORITHM_DSA`
        - `LicenseKeyPair.KEYPAIR_ALGORITHM_RSA`
        `signatureAlgorithm` - one of the signature algorithms below
        - `LicenseKeyPair.SIGNATURE_ALGORITHM_SHA1withDSA`
        - `LicenseKeyPair.SIGNATURE_ALGORITHM_MD5withRSA`
        - `LicenseKeyPair.SIGNATURE_ALGORITHM_SHA256withRSA`
        - `LicenseKeyPair.SIGNATURE_ALGORITHM_SHA512withRSA`
        `keysize` - one of the defined key sizes below
        - `LicenseKeyPair.KEYSIZE_512`
        - `LicenseKeyPair.KEYSIZE_768`
        - `LicenseKeyPair.KEYSIZE_1024`
        - `LicenseKeyPair.KEYSIZE_2048`
      Returns:
        LicenseKeyPair object
      Throws:
        `LicenseSecurityException`

    - #### loadKeyPair

          public static LicenseKeyPair loadKeyPair(java.lang.String keypairString)
                                            throws LicenseSecurityException

      Loads key pair.
      Parameters:
        `keypairString` - key pair as string
      Returns:
        LicenseKeyPair object
      Throws:
        `LicenseSecurityException`

    - #### generateLicenseText

          public static java.lang.String generateLicenseText(LicenseKeyPair keypair,
                                             LicenseText licenseTextObject)
                                                      throws LicenseSecurityException

      Generates license text from given license text object and key pair.
      Parameters:
        `keypair` -
        `licenseTextObject` -
      Returns:
        license text string
      Throws:
        `LicenseSecurityException`

    - #### generateLicenseKey

          public static java.lang.String generateLicenseKey(LicenseKeyPair keypair,
                                            LicenseKey licenseKeyObject)
                                                     throws LicenseSecurityException

      Generates cryptographically secure license key from given license key object and key pair.
      Parameters:
        `keypair` -
        `licenseKeyObject` -
      Returns:
        license key string
      Throws:
        `LicenseSecurityException`

    - #### generateLicenseKey

          public static java.lang.String generateLicenseKey(java.lang.String publickey,
                                            LicenseKey licenseKeyObject)

      Generates basic license key from given license key object and public key.
      Parameters:
        `publickey` -
        `licenseKeyObject` -
      Returns:
        license key string

    - #### getLibraryVersion

          public static java.lang.String getLibraryVersion()

      License4J library version info.
      Returns:
        License4J library version string