aesGcm method

  1. @override
AesGcm aesGcm({
  1. int secretKeyLength = 32,
  2. int nonceLength = AesGcm.defaultNonceLength,
})

A factory used by AesGcm.

Implementation

@override
AesGcm aesGcm({
  int secretKeyLength = 32,
  int nonceLength = AesGcm.defaultNonceLength,
}) {
  if (kIsWeb || nonceLength != AesGcm.defaultNonceLength) {
    return super.aesGcm(
      secretKeyLength: secretKeyLength,
      nonceLength: nonceLength,
    );
  }
  if (nonceLength == AesGcm.defaultNonceLength) {
    final platformImpl = FlutterAesGcm(
      secretKeyLength: secretKeyLength,
    );
    if (platformImpl.isSupportedPlatform) {
      return platformImpl;
    }
  }
  return BackgroundAesGcm(
    secretKeyLength: secretKeyLength,
    nonceLength: nonceLength,
  );
}