Stream: smart/health-cards
Topic: NBF quetsion
Grahame Grieve (Oct 01 2021 at 07:32):
This NBF is a valid JSON numeric, a number of seconds, but with milliseconds.
Grahame Grieve (Oct 01 2021 at 07:32):
I can't see why this would be invalid, but is this expected?
Josh Mandel (Oct 01 2021 at 13:25):
Are you referring to a specific example or tool giving you an error here? The underlying JWS spec states for NumericDate:
"Seconds Since the Epoch"... non-integer values can be represented
I don't know of any further restrictions imposed on top of that. (That said, perhaps we should recommend against fractional seconds: spending four bytes or more to get to millisecond level precision on something that can only really be treated with minute level precision owning to clock skew doesn't buy us much.)
Grahame Grieve (Oct 01 2021 at 19:30):
sorry, forgot to provide the example:
Grahame Grieve (Oct 01 2021 at 19:30):
"nbf" : 1.622690247979E9,
Grahame Grieve (Oct 01 2021 at 19:31):
while it says, non-integer values can be represented, as a standards person, I could not convince myself that it was clear that millisecond fractions were allowed. And I worry that some implementations will assume integer (even for a json numeric)
Josh Mandel (Oct 01 2021 at 20:17):
I mean, I agree -- has this come up in real life, or you're just wondering?
Grahame Grieve (Oct 01 2021 at 23:07):
this is from a candidate card intended to go into production
Grahame Grieve (Oct 01 2021 at 23:08):
but I have not seen an implementation that will go bang on that, other than mine :grinning:
Last updated: Apr 12 2022 at 19:14 UTC