Fernet constructor
Fernet(
- Key key, {
- 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;
}
}