title: Which JCE provider to use on Android ? Bouncy Castle, Conscrypt,...?
body: <p>I’m starting the development of an Android App using ECC Cryptography. I have seen that Android embeds some Cryptography (defined here <a href="https://developer.android.com/guide/topics/security/cryptography" rel="noreferrer">https://developer.android.com/guide/topics/security/cryptography</a> ) but it is limited either in term of algorithm’s parameters supported or concerning the Android API version supported. For example, “EC” parameter (aka elliptic curve cryptography) is supported by AlgorithmParameters class only for Android API version 26+ (= Android 8.0 and above) which is very restrictive.</p>
  
  <p>So far, the solution was to use a JCE provider like “Bouncy Castle”. However, I have seen on <a href="https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html" rel="noreferrer">https://android-developers.googleblog.com/2018/03/cryptography-changes-in-android-p.html</a> that it will be deprecated for the future Android P. Android P will use the cryptography features available in Conscrypt (based on boringSSL).</p>
  
  <p>I want my application to work on current Android versions (>= to API 21) and I want it to work on Android P <strong>so what JCE provider shall I use?</strong> </p>
  
  <p>I have tried to use <strong>Conscrypt</strong> with a Samsung Galaxy S7 running Android API version 24 (= Android 7.0) but I have a crash when I mount it as the security provider. 
  In my MainActivity.java class, I have used:</p>
  
  <pre><code>static {
      try {
          Security.insertProviderAt(Conscrypt.newProvider(), 1);
  
      } catch (NoClassDefFoundError e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>I get the following crash:</p>
  
  <p><em>java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String[] org.conscrypt.NativeCrypto.get_cipher_names(java.lang.String) (tried Java_org_conscrypt_NativeCrypto_get_1cipher_1names and Java_org_conscrypt_NativeCrypto_get_1cipher_1names__Ljava_lang_String_2)</em></p>
  
  <p>Do you know if Conscript can be used with current Android API versions?</p>
  
  <p>Thanks</p>