UnimplementedError: Ecdh.p256(length: 32).newKeyPair() on on Android
Does cryptography or cryptography_flutter support ECDH p256 on Android?
I have the same issue.
It seems that the CryptographyFlutterPlugin.kt should support ECDH algorithms:
https://github.com/dint-dev/cryptography/blob/4ba46dcdd8db97b9c42a2429078c6a75e7c5ab73/cryptography_flutter/android/src/main/kotlin/dev/dint/cryptography_flutter/CryptographyFlutterPlugin.kt#L56
After some debugging, I found that the the isSupportedPlatform in flutter_ecdh.dart returns false if the current platform is not a Cupertino device.
@override
bool get isSupportedPlatform =>
FlutterCryptography.isPluginPresent && isCupertino;
Maybe an easy fix would be to remove the && isCupertino statement? 🤷
This bug also happens on windows build, it seems it is forced to ios and android, leaving out all other platforms although they should be supported