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

, ,

From Scoped Storage to Photo Picker: Everything to know about Storage

Persistence is a core element of every mobile app. Android provides different APIs to access or expose files with different tradeoffs.
Watch Video

From Scoped Storage to Photo Picker: Everything to know about Storage

Yacine Rezgui
Android developer advocate
Google

From Scoped Storage to Photo Picker: Everything to know about Storage

Yacine Rezgui
Android developer ad ...
Google

From Scoped Storage to Photo Picker: Everything to know about Storage

Yacine Rezgui
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
👋 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