Blog Infos
Author
Published
Topics
,
Published
installCertificateTransparencyProvider()
The Problem with WebViews
TrustManager factories
val trustManagerFactory = TrustManagerFactory.getInstance(
    TrustManagerFactory.getDefaultAlgorithm()
)
trustManagerFactory.init(null as KeyStore?)
val x509TrustManager = trustManagerFactory
    .trustManagers
    .filterIsInstance<X509TrustManager>()
    .first()
val sslContext = SSLContext.getInstance("SSL")
sslContext.init(null, arrayOf(x509TrustManager), null)
val sslSocketFactory = sslContext.socketFactory
Introduction to Java security
Creating a TrustManagerFactory
public abstract class TrustManagerFactorySpi {
    protected abstract void engineInit(KeyStore ks);
    protected abstract void engineInit(ManagerFactoryParameters spec);

    protected abstract TrustManager[] engineGetTrustManagers();
}

Job Offers

Job Offers

There are currently no vacancies.

OUR VIDEO RECOMMENDATION

,

Overcoming Unsecurities in WebViews

Is your relationship with WebViews healthy? Sometimes you can’t avoid the need to display web content in your app. It can be a functionality that you need to release quickly and it’s already implemented by…
Watch Video

Overcoming Unsecurities in WebViews

Balázs Gerlei
Senior Mobile Software Engineer
Nevis Security

Overcoming Unsecurities in WebViews

Balázs Gerlei
Senior Mobile Softwa ...
Nevis Security

Overcoming Unsecurities in WebViews

Balázs Gerlei
Senior Mobile Software En ...
Nevis Security

Jobs

Installing a provider
class CTProvider : Provider("CT Provider", 1.0, "") {
    init {
        put("TrustManagerFactory.PKIX", CTTrustManagerFactory::class.java.name)
        put("Alg.Alias.TrustManagerFactory.X509", "PKIX")
    }
}

Then to activate our provider, all we need to do is create an instance and insert it in our preferred position. The position is 1-based; 1 is most preferred, followed by 2, etc.

Security.insertProviderAt(provider, 1)
Conclusions
installCertificateTransparencyProvider()

This article was originally published on proandroiddev.com on March 06, 2022

YOU MAY BE INTERESTED IN

YOU MAY BE INTERESTED IN

blog
👋 Hi and welcome to the third post in this series where we deep-dive…
READ MORE
blog
Protect your user’s privacy and adhere to possible technical requirements
READ MORE
blog
Security and privacy are the two most talked about topics these days. Like any…
READ MORE
blog
In this digital world, we want to stay connected with our friends and family.…
READ MORE
Menu