extractTimeStamp method

int extractTimeStamp(
  1. dynamic token
)

Returns the Unix timestamp for the token. The caller can then decide if the token is about to expire and, for example, issue a new token.

Implementation

int extractTimeStamp(dynamic token) {
  final (int timestamp, Uint8List data) =
      Fernet._getUnverifiedTokenData(token);
  // Verify the token was not tampered with.
  _verifySignature(data);
  return timestamp;
}