remoteKeyForType method

KeyInfo remoteKeyForType(
  1. String type,
  2. int keyLength
)

Generates a SecureKey of keyLength bytes for the given type.

Internally, this will generate the key based on the master key, the type and a key id derived from the current time as reported by clock.

Both the generated key and the id are returned as KeyInfo.

Implementation

KeyInfo remoteKeyForType(String type, int keyLength) {
  final keyId = _keyIdForDate(clock.now());
  final secureKey = remoteKeyForTypeAndId(type, keyId, keyLength);
  return KeyInfo(keyId, secureKey);
}