activateSerialKey static method
Activates a license using a serial 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 serialKey The serial key to activate. param commentary Commentary associated to this license activation, generally the host name. param path Path to the license file. throws DocumentException An error has occurred during Document Library execution.
Implementation
static void activateSerialKey(String? hardwareCode, String? serialKey, String? commentary, String? path) {
Pointer<Char>? pHardwareCode = hardwareCode?.toNativeUtf8().cast<Char>();
Pointer<Char>? pSerialKey = serialKey?.toNativeUtf8().cast<Char>();
Pointer<Char>? pCommentary = commentary?.toNativeUtf8().cast<Char>();
Pointer<Char>? pPath = path?.toNativeUtf8().cast<Char>();
try {
var err = documentSDK.id3DocumentLicense_ActivateSerialKey(pHardwareCode ?? nullptr, pSerialKey ?? nullptr, pCommentary ?? nullptr, pPath ?? nullptr);
if (err != DocumentError.success.value) {
throw DocumentException(err);
}
} finally {
if (pHardwareCode != null) {
calloc.free(pHardwareCode);
}
if (pSerialKey != null) {
calloc.free(pSerialKey);
}
if (pCommentary != null) {
calloc.free(pCommentary);
}
if (pPath != null) {
calloc.free(pPath);
}
}
}