checkLicenseWithCard static method
- String? licensePath
Checks the license by using a card-based verification process. It takes the path to the license file and outputs a challenge response for further verification.
param licensePath The file path to the license that needs to be checked. return An array to hold the challenge response generated by the host. throws BiosealException An error has occurred during Bioseal Library execution.
Implementation
static Uint8List checkLicenseWithCard(String? licensePath) {
Pointer<Char>? pLicensePath = licensePath?.toNativeUtf8().cast<Char>();
Pointer<UnsignedChar> pChallengeR1 = calloc.allocate(16);
Pointer<Int> pChallengeR1Size = calloc.allocate(1);
pChallengeR1Size[0] = 16;
try {
var err = biosealSDK.id3BiosealLicense_CheckLicenseWithCard(pLicensePath ?? nullptr, pChallengeR1, pChallengeR1Size);
if (err == BiosealError.insufficientBuffer.value) {
calloc.free(pChallengeR1);
pChallengeR1 = calloc.allocate(pChallengeR1Size.value);
err = biosealSDK.id3BiosealLicense_CheckLicenseWithCard(pLicensePath ?? nullptr, pChallengeR1, pChallengeR1Size);
}
if (err != BiosealError.success.value) {
throw BiosealException(err);
}
final vChallengeR1 = Uint8List.fromList(pChallengeR1.cast<Uint8>().asTypedList(pChallengeR1Size.value));
return vChallengeR1;
} finally {
if (pLicensePath != null) {
calloc.free(pLicensePath);
}
calloc.free(pChallengeR1);
calloc.free(pChallengeR1Size);
}
}