I am trying to write an ECDH code for my android app. As a starting point, I managed to instal lSpongyCastle Jar's on my AndroidStudion, but now I am having an issue when I run:
KeyPairGenerator aliceKeyGen = KeyPairGenerator.getInstance("ECDH", "SC");
It keeps saying that there is no such provider, however I have added
Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1);
to my code, and I have added the
implementation 'com.madgag.spongycastle:prov:1.58.0.0'
to my gradle.
I have tried different provider names (such as "BC") but all gave me the same error 'NoSuchProviderException'
I have tried reading everywhere without success, please let me know what I am doing wrong and what else I should do.
Thank you!
PS Needless to say, other functions of SpongyCastle are working properly, so I believe I have installed the library successfully.