to top
Android APIs
public class

X509TrustManagerExtensions

extends Object
java.lang.Object
   ↳ android.net.http.X509TrustManagerExtensions

Class Overview

X509TrustManager wrapper exposing Android-added features.

The checkServerTrusted method allows callers to perform additional verification of certificate chains after they have been successfully verified by the platform.

Summary

Public Constructors

? Examples
X509TrustManagerExtensions( X509TrustManager tm)
Constructs a new X509TrustManagerExtensions wrapper.
Public Methods

? Examples
List< X509Certificate> checkServerTrusted( X509Certificate[] chain, String authType, String host)
Verifies the given certificate chain.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public X509TrustManagerExtensions (X509TrustManager tm)

Added in API level 17

Constructs a new X509TrustManagerExtensions wrapper.

Parameters
tm A X509TrustManager as returned by TrustManagerFactory.getInstance();
Throws
IllegalArgumentException If tm is an unsupported TrustManager type.

Public Methods

public List<X509Certificate> checkServerTrusted (X509Certificate[] chain, String authType, String host)

Added in API level 17

Verifies the given certificate chain.

See checkServerTrusted(X509Certificate[], String) for a description of the chain and authType parameters. The final parameter, host, should be the hostname of the server.

Returns
  • the properly ordered chain used for verification as a list of X509Certificates.
Throws
CertificateException if the chain does not verify correctly.
No examples for this method.
Frequently called with: [Clear]
Portions of this page are reproduced from work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. The original page is available here.