getIssuerCountry method

String getIssuerCountry()

Gets the the country (C) of the certificate issuer.

return The country (C) of the certificate issuer. throws BiosealException An error has occurred during Bioseal Library execution.

Implementation

String getIssuerCountry() {
  Pointer<Char> pIssuerCountry = nullptr;
  Pointer<Int> pIssuerCountrySize = calloc.allocate(1);
  pIssuerCountrySize[0] = -1;
  try {
    var err = biosealSDK.id3BiosealCertificateInformation_GetIssuerCountry(_pHandle.value, pIssuerCountry, pIssuerCountrySize);
    if (err == BiosealError.insufficientBuffer.value) {
      pIssuerCountry = calloc.allocate(pIssuerCountrySize.value);
      err = biosealSDK.id3BiosealCertificateInformation_GetIssuerCountry(_pHandle.value, pIssuerCountry, pIssuerCountrySize);
      if (err != BiosealError.success.value) {
        throw BiosealException(err);
      }
    }
    final vIssuerCountry = utf8.decode(Uint8List.fromList(pIssuerCountry.cast<Uint8>().asTypedList(pIssuerCountrySize.value)));
    return vIssuerCountry;
  } finally {
    calloc.free(pIssuerCountry);
    calloc.free(pIssuerCountrySize);
  }
}