checkLicenseBuffer static method

void checkLicenseBuffer(
  1. Uint8List? licenseData
)

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.

param licenseData A buffer containing the license file data. throws BiosealException An error has occurred during Bioseal Library execution.

Implementation

static void checkLicenseBuffer(Uint8List? licenseData) {
  Pointer<UnsignedChar>? pLicenseData;
  if (licenseData != null) {
  	pLicenseData = calloc.allocate<UnsignedChar>(licenseData.length);
  	pLicenseData.cast<Uint8>().asTypedList(licenseData.length).setAll(0, licenseData);
  }
  Pointer<Void> pOptionalParameter = nullptr;
		if (Platform.isAndroid) {
			pOptionalParameter = getJniEnvPtr();
		}
  try {
    var err = biosealSDK.id3BiosealLicense_CheckLicenseBuffer(pLicenseData ?? nullptr, licenseData?.length ?? 0, pOptionalParameter);
    if (err != BiosealError.success.value) {
      throw BiosealException(err);
    }
  } finally {
    if (pLicenseData != null) {
      calloc.free(pLicenseData);
    }
  }
}