google / conscrypt

Conscrypt is a Java Security Provider that implements parts of the Java Cryptography Extension and Java Secure Socket Extension.
Apache License 2.0
1.29k stars 275 forks source link

Where to find any example of how to use Conscrypt? #828

Open dariush-fathie opened 4 years ago

dariush-fathie commented 4 years ago

Hi Everyone. I searched and can't find any guide on how to implement and use conscript.

please share an example of using hashing or ecrypting|decripting algorithms.

Thank you all

hyperxpro commented 4 years ago

Just add Conscrypt as Provider in normal JCE code.

louiewh commented 4 years ago

@hyperxpro add Conscrypt as Provider in normal JCE code at android platform can work? I understand android already has a conscrypt at system.

o2e commented 4 years ago
Security.addProvider(Conscrypt.newProvider());
Security.insertProviderAt(Conscrypt.newProvider(),0);
SSLContext sslContext = SSLContext.getInstance("TLSv1.3", Conscrypt.newProvider());

聪明的你可以选择一个合适的方式来使用它。 Smart you can choose a suitable way to use it.

yschimke commented 3 years ago

Here is an example from OkHttp tests https://github.com/square/okhttp/blob/master/android-test/src/androidTest/java/okhttp/android/test/OkHttpTest.kt#L171

Worth noting that the example above with insertProviderAt, is possibly broken as it is 1 based (based on javadoc) and likely inserts at the end.