askarKeyGetJwkThumbprint function
Implementation
AskarResult<String> askarKeyGetJwkThumbprint(LocalKeyHandle handle, KeyAlgorithm alg) {
Pointer<Pointer<Utf8>> utf8PtPointer = calloc<Pointer<Utf8>>();
Pointer<Utf8> algPointer = nullptr;
try {
algPointer = alg.value.toNativeUtf8();
final funcResult = nativeAskarKeyGetJwkThumbprint(
handle.toInt(),
algPointer,
utf8PtPointer,
);
final errorCode = ErrorCode.fromInt(funcResult);
final String value =
(errorCode == ErrorCode.success) ? utf8PtPointer.value.toDartString() : "";
return AskarResult<String>(errorCode, value);
} finally {
freeDoublePointer(utf8PtPointer);
freePointer(algPointer);
}
}