# getApplicationHardwareCode static method

String getApplicationHardwareCode(

1. String? applicationName,
2. String? certificate

)

Build an application hardware code.

param applicationName The application name. param certificate The certificate. return The application hardware code. throws BiosealException An error has occurred during Bioseal Library execution.

## Implementation

    static String getApplicationHardwareCode(String? applicationName, String? certificate) {
      Pointer<Char>? pApplicationName = applicationName?.toNativeUtf8().cast<Char>();
      Pointer<Char>? pCertificate = certificate?.toNativeUtf8().cast<Char>();
      Pointer<Char> pCode = nullptr;
      Pointer<Int> pCodeSize = calloc.allocate(1);
      pCodeSize[0] = -1;
      try {
        var err = biosealSDK.id3BiosealLicense_GetApplicationHardwareCode(pApplicationName ?? nullptr, pCertificate ?? nullptr, pCode, pCodeSize);
        if (err == BiosealError.insufficientBuffer.value) {
          pCode = calloc.allocate(pCodeSize.value);
          err = biosealSDK.id3BiosealLicense_GetApplicationHardwareCode(pApplicationName ?? nullptr, pCertificate ?? nullptr, pCode, pCodeSize);
          if (err != BiosealError.success.value) {
            throw BiosealException(err);
          }
        }
        final vCode = utf8.decode(Uint8List.fromList(pCode.cast<Uint8>().asTypedList(pCodeSize.value)));
        return vCode;
      } finally {
        if (pApplicationName != null) {
          calloc.free(pApplicationName);
        }
        if (pCertificate != null) {
          calloc.free(pCertificate);
        }
        calloc.free(pCode);
        calloc.free(pCodeSize);
      }
    }