# activateActivationKey static method

void activateActivationKey(

1. String? hardwareCode,
2. String? activationKey,
3. String? commentary,
4. String? path

)

Activates a license file using an activation key and saves the license to a file.

param hardwareCode The hardware code on which the license file will be attached, to be retrieved using the GetHostHardwareCode function. param activationKey The activation key. param commentary Commentary associated to this license activation, generally the host name. param path Path to the retrieved license file. throws BiosealException An error has occurred during Bioseal Library execution.

## Implementation

    static void activateActivationKey(String? hardwareCode, String? activationKey, String? commentary, String? path) {
      Pointer<Char>? pHardwareCode = hardwareCode?.toNativeUtf8().cast<Char>();
      Pointer<Char>? pActivationKey = activationKey?.toNativeUtf8().cast<Char>();
      Pointer<Char>? pCommentary = commentary?.toNativeUtf8().cast<Char>();
      Pointer<Char>? pPath = path?.toNativeUtf8().cast<Char>();
      try {
        var err = biosealSDK.id3BiosealLicense_ActivateActivationKey(pHardwareCode ?? nullptr, pActivationKey ?? nullptr, pCommentary ?? nullptr, pPath ?? nullptr);
        if (err != BiosealError.success.value) {
          throw BiosealException(err);
        }
      } finally {
        if (pHardwareCode != null) {
          calloc.free(pHardwareCode);
        }
        if (pActivationKey != null) {
          calloc.free(pActivationKey);
        }
        if (pCommentary != null) {
          calloc.free(pCommentary);
        }
        if (pPath != null) {
          calloc.free(pPath);
        }
      }
    }