org.w3c.mwi.mobileok.basic
Class MobileOKTrustManager

java.lang.Object
  extended by org.w3c.mwi.mobileok.basic.MobileOKTrustManager
All Implemented Interfaces:
javax.net.ssl.TrustManager, javax.net.ssl.X509TrustManager

public class MobileOKTrustManager
extends java.lang.Object
implements javax.net.ssl.X509TrustManager

Trust manager that checks the validity of an X509 server certificate against the mobileOK trust rules defined in the HTTPS section of the W3C mobileOK Basic Tests 1.0 standard.

The class should be set as the trust manager of the SSLContext through a call to SSLContext.init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], java.security.SecureRandom) before creating the secure socket to the server.

Since arbitrary root certificates are to be regarded as trusted in mobileOK, the class merely checks that the server certificate associated with the secure socket is currently valid (i.e. that current date lays between the certificate's activation and expiration dates).

Version:
$Revision: 1.1 $
Author:
The W3C mobileOK Checker Task Force
See Also:
MobileOKSSLProtocolSocketFactory

Field Summary
private static java.security.cert.X509Certificate[] acceptedIssuers
           
private  HTTPErrorsType httperror
           
 
Constructor Summary
MobileOKTrustManager()
           
 
Method Summary
 void checkClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)
           
 void checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)
           
 java.security.cert.X509Certificate[] getAcceptedIssuers()
           
 HTTPErrorsType getHttperror()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httperror

private HTTPErrorsType httperror

acceptedIssuers

private static final java.security.cert.X509Certificate[] acceptedIssuers
Constructor Detail

MobileOKTrustManager

public MobileOKTrustManager()
Method Detail

checkClientTrusted

public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
                               java.lang.String authType)
Specified by:
checkClientTrusted in interface javax.net.ssl.X509TrustManager

checkServerTrusted

public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
                               java.lang.String authType)
Specified by:
checkServerTrusted in interface javax.net.ssl.X509TrustManager

getAcceptedIssuers

public java.security.cert.X509Certificate[] getAcceptedIssuers()
Specified by:
getAcceptedIssuers in interface javax.net.ssl.X509TrustManager

getHttperror

public HTTPErrorsType getHttperror()