Fernet constructor

Fernet(
  1. Key key, {
  2. Clock? clock,
})

Implementation

Fernet(Key key, {Clock? clock}) {
  if (key.length != 32) {
    throw StateError('Fernet key must be 32 url-safe base64-encoded bytes.');
  }
  _signKey = Key(Uint8List.fromList(key.bytes.sublist(0, 16)));
  _encryptionKey = Key(Uint8List.fromList(key.bytes.sublist(16)));
  if (clock == null) {
    _clock = Clock();
  } else {
    _clock = clock;
  }
}