encryptAtTime method

Uint8List encryptAtTime(
  1. Uint8List data,
  2. int currentTime
)

Encrypts data passed using explicitly passed currentTime. See Fernet.encrypt for the documentation of the data parameter.

The motivation behind this method is for the client code to be able to test token expiration. Since this method can be used in an insecure manner one should make sure the correct time is passed as currentTime outside testing.

Implementation

Uint8List encryptAtTime(final Uint8List data, final int currentTime) =>
    _encryptFromParts(data, currentTime, CryptoUtils.secureRandomBytes(16));