Commit 606879cb authored by Him188's avatar Him188

Test ECDH keyPair before success

parent 8b24b08c
...@@ -46,6 +46,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) { ...@@ -46,6 +46,7 @@ actual class ECDH actual constructor(actual val keyPair: ECDHKeyPair) {
init { init {
if (kotlin.runCatching { if (kotlin.runCatching {
Security.addProvider(BouncyCastleProvider()) Security.addProvider(BouncyCastleProvider())
generateKeyPair() // try if it is working
}.exceptionOrNull() == null) { }.exceptionOrNull() == null) {
isECDHAvailable = true isECDHAvailable = true
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment