newSecretKeyFromBytes method

  1. @override
Future<SecretKey> newSecretKeyFromBytes(
  1. List<int> bytes
)
inherited

Constructs a new SecretKey from the bytes.

Throws ArgumentError if the argument length is not secretKeyLength.

Implementation

@override
Future<SecretKey> newSecretKeyFromBytes(List<int> bytes) {
  if (bytes.length != secretKeyLength) {
    throw ArgumentError('Invalid secret key length');
  }
  return Future<_DartAesSecretKeyData>.value(
    _DartAesSecretKeyData(bytes),
  );
}