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 Team Lead

    Komoot
    Remote EMEA
    • Full Time
    apply now

    Information Security Engineer

    MongoDB
    London, UK
    • Full Time
    apply now

    Flutter Developers and Architects

    Rebell App Studio by Codemate
    Helsinki, Oulu, Bangkok
    • Full Time
    apply now
Load more listings

OUR VIDEO RECOMMENDATION

,

Monetizing your Flutter App

How can you smartly integrate advertising and in-app purchases to monetize your Flutter app? Using the popular word game 4 Pics 1 Word as an example, we will explore the basic procedure and best practices…
Watch Video

Monetizing your Flutter App

Petra Langenbacher & Joachim Böhmer
Software Developer
Lotum

Monetizing your Flutter App

Petra Langenbacher ...
Software Developer
Lotum

Monetizing your Flutter App

Petra Langenbach ...
Software Developer
Lotum

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
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
blog
👋 Hi and welcome to the second post in this series where we deep-dive…
READ MORE

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Menu