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


    Android Engineer

    American Express
    London | New York | Phoenix
    • Full Time
    apply now

    Android Developer

    Small and Modern GmbH
    Hamburg, Remote (Germany)
    • Full Time
    apply now

    Senior Android Developer (Remote)

    Komoot
    Europe
    • Full Time
    apply now
Load more listings

OUR VIDEO RECOMMENDATION

, ,

The Evolution of Android Graphics in Android 12/13

Android 12 and 13 both added significant new capabilities to Android platform graphics, including RenderEffect, RuntimeShader, and more. At the same time, RenderScript has been deprecated and we’ve introduced the RenderScript Intrinsics Replacement Toolkit. This…
Watch Video

The Evolution of Android Graphics in Android 12/13

Daniel Galpin
Android Developer Advocate and Fast Talking YouTuber
Google

The Evolution of Android Graphics in Android 12/13

Daniel Galpin
Android Developer Ad ...
Google

The Evolution of Android Graphics in Android 12/13

Daniel Galpin
Android Developer Advocat ...
Google

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
Security and privacy are the two most talked about topics these days. Like any…
READ MORE
blog
👋 Hi and welcome to the second post in this series where we deep-dive…
READ MORE
blog
👋 Hi and welcome to a new series of blog posts in which we…
READ MORE

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.

Menu