Open
Description
I found https cost more time on rust than java, then I found function verifyCertificateChain cost most time
CertificateVerifier.kt
Log.d(TAG, "verifyCertificateChain PKIXBuilderParameters start")
val parameters = PKIXBuilderParameters(keystore, null)
Log.d(TAG, "verifyCertificateChain PKIXBuilderParameters end")
it cost 200ms every request
If change it, we can save time
var trustAnchors = HashSet<TrustAnchor>()
validChain.forEach {
trustAnchors.add(TrustAnchor(it, null));
}
var pkixParameters = PKIXParameters(trustAnchors)
pkixParameters.certPathCheckers = listOf(revocationChecker)
pkixParameters.isRevocationEnabled = false
validator.validate(certFactory.generateCertPath(validChain), pkixParameters)
I have already try and it did work, so can we do this?