• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps CRL check

LighterV

Lurker
Hi!

In my Android application I use apache HttpClient. How can I enable CRL check?

In Java SE I can use the following code:

[HIGH]PKIXBuilderParameters pkixParams = new PKIXBuilderParameters(truststore, new X509CertSelector());
CollectionCertStoreParameters params = new CollectionCertStoreParameters(crls);
CertStore store = CertStore.getInstance("Collection", params);
pkixParams.addCertStore(store);
pkixParams.setRevocationEnabled(true);
ManagerFactoryParameters trustParams =
new CertPathTrustManagerParameters(pkixParams);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(trustParams);

KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(keystore, keystorePassword.toCharArray());

this.sslcontext = SSLContext.getInstance(algorithm);
this.sslcontext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);[/HIGH]

But it does not work in Android because there is no appropriate crypto provider.
 
Back
Top Bottom