Test ECDH keyPair before success

This commit is contained in:
Him188 2020-02-16 00:19:53 +08:00
parent 8b24b08c3d
commit 606879cba1

View File

@ -46,6 +46,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) {
init {
if (kotlin.runCatching {
Security.addProvider(BouncyCastleProvider())
generateKeyPair() // try if it is working
}.exceptionOrNull() == null) {
isECDHAvailable = true
}