Skip to content

Can I optimize this on Android? #66

Open
@laiyi55

Description

@laiyi55

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-AndroidWork related to the Android verifier implementationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions