JwtParser.create constructor
Implementation
factory JwtParser.create(String token, {DateTime? currentTime}) {
Pointer<Int64> epochSecs = nullptr;
if (currentTime != null) {
epochSecs = calloc<Int64>();
epochSecs.value =
(currentTime.toUtc().millisecondsSinceEpoch / 1000).round();
}
final nativeToken = token.toNativeUtf8();
try {
final parser = DartApi.native.jwtParser
.create(nativeToken, epochSecs)
.extract((res) => res.asPointer<Void>());
return JwtParser(parser, true);
} finally {
calloc.free(nativeToken);
}
}