private static AlgorithmParameterSpec getJavaX25519ParameterSpec() {
    try {
      Class<?> cls = Class.forName("java.security.spec.NamedParameterSpec");
      Field field = cls.getDeclaredField("X25519");
      Object result = field.get(null);
      return (AlgorithmParameterSpec) result;
    } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException ignored) {
      return null;
    }
  }
An implementation of a {@link KeyFactorySpi} for XEC keys based on BoringSSL.
common/src/main/java/org/conscrypt/OpenSSLXDHKeyFactory.java