eu.id3.bioseal

## Class BiosealLicense

- java.lang.Object
- - eu.id3.bioseal.BiosealLicense

-     public class BiosealLicense
      extends java.lang.Object

  Handles the license to use this SDK.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BiosealLicense()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `activate(java.lang.String hardwareCode, java.lang.String login, java.lang.String password, java.lang.String productReference, java.lang.String commentary, java.lang.String path)` Activates a license using customer credentials and a product reference and saves the license to a file.
    `static void` | `activateActivationKey(java.lang.String hardwareCode, java.lang.String activationKey, java.lang.String commentary, java.lang.String path)` Activates a license file using an activation key and saves the license to a file.
    `static byte[]` | `activateActivationKeyBuffer(java.lang.String hardwareCode, java.lang.String activationKey, java.lang.String commentary)` Activates a license using an activation key and returns the license in a data buffer.
    `static byte[]` | `activateBuffer(java.lang.String hardwareCode, java.lang.String login, java.lang.String password, java.lang.String productReference, java.lang.String commentary)` Retrieves a license file buffer using customer credentials and a product reference and returns the license in a data buffer.
    `static void` | `activateSerialKey(java.lang.String hardwareCode, java.lang.String serialKey, java.lang.String commentary, java.lang.String path)` Activates a license using a serial key and saves the license to a file.
    `static byte[]` | `activateSerialKeyBuffer(java.lang.String hardwareCode, java.lang.String serialKey, java.lang.String commentary)` Activates a license using a serial key and returns the license in a data buffer.
    `static void` | `checkLicense(java.lang.String licensePath)` Checks a license from a file.
    `static void` | `checkLicenseBuffer(byte[] licenseData)` Checks a license from a buffer.
    `static byte[]` | `checkLicenseBufferWithCard(byte[] licenseData)` Checks the license using a buffer containing the license data and a card-based verification process.
    `static byte[]` | `checkLicenseWithCard(java.lang.String licensePath)` Checks the license by using a card-based verification process.
    `static void` | `checkModule(java.lang.String moduleName)` Checks if a module is present in the previously loaded license.
    `static byte[]` | `encrypt(java.lang.String magicCode, java.lang.String src)` Encrypt a license from XML source.
    `static void` | `finalizeCheckLicenseWithCard(byte[] cryptogram)` Finalizes the license check process using the provided cryptogram.
    `static java.lang.String` | `getApplicationHardwareCode(java.lang.String applicationName, java.lang.String certificate)` Build an application hardware code.
    `static java.lang.String` | `getExpiryDate()` Retrieves the license expiry date.
    `static java.lang.String` | `getExternalDriveHardwareCode(LicenseHardwareCodeType hardwareCodeType, java.lang.String externalDrivePath)` Retrieves the hardware code of the external drive you run the library on.
    `static java.lang.String` | `getHostHardwareCode(LicenseHardwareCodeType hardwareCodeType)` Retrieves the hardware code of the device using the requested hardware code type.
    `static java.lang.String` | `getLicenseComment()` Retrieves the license comment.
    `static java.lang.String` | `getLicenseFileHardwareCode()` Retrieves the hardware code of the previously loaded license.
    `static java.lang.String` | `getLicenseFileSerial()` Retrieves the serial number of the previously loaded license.
    `static java.lang.String` | `getLicenseName()` Retrieves the license name.
    `static java.lang.String` | `getLicenseOwner()` Retrieves the license owner.
    `static java.lang.String` | `getLicensePath()` Retrieves the license path.
    `static LicenseType` | `getLicenseType()` Retrieves the license type.
    `static int` | `getModuleCount()` Retrieves the number of modules in the license.
    `static java.lang.String` | `getModuleName(int index)` Retrieves the name of the specified license module.
    `static int` | `getModuleValue(java.lang.String name)` Retrieves the value associated to the specified license module.
    `static java.lang.String` | `getProductReference()` Retrieves the license product reference.
    `static int` | `getRemainingDays()` Retrieves the number of remaining days.
    `static void` | `reactivate(java.lang.String hardwareCode, java.lang.String productReference, java.lang.String path)` Reactivates a license file using the host hardware code and the product reference.
    `static byte[]` | `reactivateBuffer(java.lang.String hardwareCode, java.lang.String productReference)` Reactivates a license in a data buffer using the host hardware code and the product reference.

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

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

- - ### Constructor Detail

    - #### BiosealLicense

          public BiosealLicense()

  - ### Method Detail

    - #### checkLicense

          public static void checkLicense(java.lang.String licensePath)
                                   throws BiosealException

      Checks a license from a file. This function does two things: - First it loads the license from a file using the given path - Then it checks the validity of the license regarding the host it is called on (Windows, Linux, Android ...) Important: Calling this function is required to get access to the license member getters. Note: The optional parameter is required on Android and must be the JNIEnv* pointer casted as a void*. It can be set as NULL for other devices.
      Parameters:
        `licensePath` - Absolute or relative path to the license file.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### checkLicenseBuffer

          public static void checkLicenseBuffer(byte[] licenseData)
                                         throws BiosealException

      Checks a license from a buffer. This function does two things: - First it loads the license from a buffer - Then it checks the validity of the license regarding the host it is called on (Windows, Linux, Android ...) Important: Calling one of the license checking function is required to get access to all the license member getters. Note: The optional parameter is required on Android and must be the JNIEnv* pointer casted as a void*. It can be set as NULL for other devices.
      Parameters:
        `licenseData` - A buffer containing the license file data.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### checkModule

          public static void checkModule(java.lang.String moduleName)
                                  throws BiosealException

      Checks if a module is present in the previously loaded license.
      Parameters:
        `moduleName` - The module name.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getModuleCount

          public static int getModuleCount()
                                    throws BiosealException

      Retrieves the number of modules in the license.
      Returns:
        The number of modules in the license.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getModuleName

          public static java.lang.String getModuleName(int index)
                                                throws BiosealException

      Retrieves the name of the specified license module.
      Parameters:
        `index` - Index of the module, starting from 0.
      Returns:
        The license module name.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getModuleValue

          public static int getModuleValue(java.lang.String name)
                                    throws BiosealException

      Retrieves the value associated to the specified license module.
      Parameters:
        `name` - Name of the requested module.
      Returns:
        The value associated to the licence module.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicenseName

          public static java.lang.String getLicenseName()
                                                 throws BiosealException

      Retrieves the license name.
      Returns:
        The license name.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicenseType

          public static LicenseType getLicenseType()
                                            throws BiosealException

      Retrieves the license type.
      Returns:
        The license type.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicenseOwner

          public static java.lang.String getLicenseOwner()
                                                  throws BiosealException

      Retrieves the license owner.
      Returns:
        The license owner.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getProductReference

          public static java.lang.String getProductReference()
                                                      throws BiosealException

      Retrieves the license product reference.
      Returns:
        The product reference.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicensePath

          public static java.lang.String getLicensePath()
                                                 throws BiosealException

      Retrieves the license path.
      Returns:
        The license path.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getRemainingDays

          public static int getRemainingDays()
                                      throws BiosealException

      Retrieves the number of remaining days.
      Returns:
        The number of remaining days.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getExpiryDate

          public static java.lang.String getExpiryDate()
                                                throws BiosealException

      Retrieves the license expiry date.
      Returns:
        The license expiry date.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicenseFileHardwareCode

          public static java.lang.String getLicenseFileHardwareCode()
                                                             throws BiosealException

      Retrieves the hardware code of the previously loaded license.
      Returns:
        The license hardware code.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicenseFileSerial

          public static java.lang.String getLicenseFileSerial()
                                                       throws BiosealException

      Retrieves the serial number of the previously loaded license.
      Returns:
        The license serial number.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getHostHardwareCode

          public static java.lang.String getHostHardwareCode(LicenseHardwareCodeType hardwareCodeType)
                                                      throws BiosealException

      Retrieves the hardware code of the device using the requested hardware code type. This function retrieves the hardware code of the device you run the library on. The optional parameter is required: - On Android, it must be the JNIEnv* pointer cast as a void*. - In other cases, it must be set to NULL.
      Parameters:
        `hardwareCodeType` - The requested hardware code type.
      Returns:
        The device hardware code.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getExternalDriveHardwareCode

          public static java.lang.String getExternalDriveHardwareCode(LicenseHardwareCodeType hardwareCodeType,
                                                                      java.lang.String externalDrivePath)
                                                               throws BiosealException

      Retrieves the hardware code of the external drive you run the library on. This function works on Windows only.
      Parameters:
        `hardwareCodeType` - The requested hardware code type. Must be windowsUsb.
        `externalDrivePath` - On Windows to activate a license on a USB device, it must contain the path to the requested USB drive (e.g 'G:\').
      Returns:
        The device hardware code.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getLicenseComment

          public static java.lang.String getLicenseComment()
                                                    throws BiosealException

      Retrieves the license comment.
      Returns:
        The license comment.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### activate

          public static void activate(java.lang.String hardwareCode,
                                      java.lang.String login,
                                      java.lang.String password,
                                      java.lang.String productReference,
                                      java.lang.String commentary,
                                      java.lang.String path)
                               throws BiosealException

      Activates a license using customer credentials and a product reference and saves the license to a file.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `login` - The id3 account login.
        `password` - The id3 account password.
        `productReference` - The requested product reference.
        `commentary` - Commentary associated to this license activation.
        `path` - Path to the retrieved license file.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### activateBuffer

          public static byte[] activateBuffer(java.lang.String hardwareCode,
                                              java.lang.String login,
                                              java.lang.String password,
                                              java.lang.String productReference,
                                              java.lang.String commentary)
                                       throws BiosealException

      Retrieves a license file buffer using customer credentials and a product reference and returns the license in a data buffer.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `login` - The customer login.
        `password` - The customer password.
        `productReference` - The requested product reference.
        `commentary` - Commentary associated to this license activation, generally the host name.
      Returns:
        The license data.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### activateSerialKey

          public static void activateSerialKey(java.lang.String hardwareCode,
                                               java.lang.String serialKey,
                                               java.lang.String commentary,
                                               java.lang.String path)
                                        throws BiosealException

      Activates a license using a serial key and saves the license to a file.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `serialKey` - The serial key to activate.
        `commentary` - Commentary associated to this license activation, generally the host name.
        `path` - Path to the license file.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### activateSerialKeyBuffer

          public static byte[] activateSerialKeyBuffer(java.lang.String hardwareCode,
                                                       java.lang.String serialKey,
                                                       java.lang.String commentary)
                                                throws BiosealException

      Activates a license using a serial key and returns the license in a data buffer.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `serialKey` - The id3 serial key.
        `commentary` - Commentary associated to this license activation.
      Returns:
        The license data buffer.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### activateActivationKey

          public static void activateActivationKey(java.lang.String hardwareCode,
                                                   java.lang.String activationKey,
                                                   java.lang.String commentary,
                                                   java.lang.String path)
                                            throws BiosealException

      Activates a license file using an activation key and saves the license to a file.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `activationKey` - The activation key.
        `commentary` - Commentary associated to this license activation, generally the host name.
        `path` - Path to the retrieved license file.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### activateActivationKeyBuffer

          public static byte[] activateActivationKeyBuffer(java.lang.String hardwareCode,
                                                           java.lang.String activationKey,
                                                           java.lang.String commentary)
                                                    throws BiosealException

      Activates a license using an activation key and returns the license in a data buffer.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `activationKey` - The id3 activation key.
        `commentary` - Commentary associated to this license activation.
      Returns:
        The license data buffer.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### reactivate

          public static void reactivate(java.lang.String hardwareCode,
                                        java.lang.String productReference,
                                        java.lang.String path)
                                 throws BiosealException

      Reactivates a license file using the host hardware code and the product reference.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `productReference` - The product reference.
        `path` - Path to the license file.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### reactivateBuffer

          public static byte[] reactivateBuffer(java.lang.String hardwareCode,
                                                java.lang.String productReference)
                                         throws BiosealException

      Reactivates a license in a data buffer using the host hardware code and the product reference.
      Parameters:
        `hardwareCode` - The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function.
        `productReference` - The product reference.
      Returns:
        The new license data buffer.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### checkLicenseWithCard

          public static byte[] checkLicenseWithCard(java.lang.String licensePath)
                                             throws BiosealException

      Checks the license by using a card-based verification process. It takes the path to the license file and outputs a challenge response for further verification.
      Parameters:
        `licensePath` - The file path to the license that needs to be checked.
      Returns:
        An array to hold the challenge response generated by the host.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### checkLicenseBufferWithCard

          public static byte[] checkLicenseBufferWithCard(byte[] licenseData)
                                                   throws BiosealException

      Checks the license using a buffer containing the license data and a card-based verification process. It outputs a challenge response for further verification.
      Parameters:
        `licenseData` - A buffer containing the license file data.
      Returns:
        An array to hold the challenge response generated by the host.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### finalizeCheckLicenseWithCard

          public static void finalizeCheckLicenseWithCard(byte[] cryptogram)
                                                   throws BiosealException

      Finalizes the license check process using the provided cryptogram. It ensures the integrity and authenticity of the license verification.
      Parameters:
        `cryptogram` - A 32-byte array containing the cryptogram used for final verification.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### encrypt

          public static byte[] encrypt(java.lang.String magicCode,
                                       java.lang.String src)
                                throws BiosealException

      Encrypt a license from XML source.
      Parameters:
        `magicCode` - Access key.
        `src` - XML source.
      Returns:
        Encrypted license data.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

    - #### getApplicationHardwareCode

          public static java.lang.String getApplicationHardwareCode(java.lang.String applicationName,
                                                                    java.lang.String certificate)
                                                             throws BiosealException

      Build an application hardware code.
      Parameters:
        `applicationName` - The application name.
        `certificate` - The certificate.
      Returns:
        The application hardware code.
      Throws:
        `BiosealException` - An error has occurred during Bioseal Library execution.

Copyright © 2020-2030, id3 Technologies. All rights reserved. eu.id3.bioseal