| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fhg.igd.semoa.net.SSLTrustManager
SSLTrustManager implements the X509TrustManager class from java ssl package.
 This is unavoidable in order to redirect the certificate verification by
 the KeyMaster class.
 Keep in mind, that logging to System.out or System.err is not possible
 within callback methods, because data would be transfered over SSL stream!
| Field Summary | |
| private  Set | acceptedSubjects_A certificate, which has successfully been verified, will be accepted by checkClientTrustedresp. | 
| static String | AUTH_TYPEThe variable AUTH_TYPE determine authentication type used in SSL process. | 
| protected  int | flag_The flag identifying the type of trust checks which are made when checkClientTrustedorcheckClientTrustedis called. | 
| private  String | id_The id used to identify error messages. | 
| static int | ISSUER_TRUST_CHECKWhen checkClientTrustedorcheckServerTrustedis called, the given certificate chain is verified and the root CA
 certificate is validated against the trusted certificates of theKeyMaster. | 
| private  KeyMaster | keymaster_The KeyMaster. | 
| private  long | lastFetch_The time at which the key master reference was fetched last. | 
| private  Object | lock_A private lock object to synchronize on. | 
| private static Logger | log_The Loggerinstance for this class | 
| static int | NO_TRUST_CHECKNo trust check is done at all, when checkClientTrustedorcheckServerTrustedis called. | 
| static int | SUBJECT_TRUST_CHECKIn addition to the checks made when flag_isISSUER_TRUST_CHECK, the subject DN of the given 
 certificate is compared against a given set ofacceptedSubjects_. | 
| Constructor Summary | |
| SSLTrustManager()Default constructor. | |
| SSLTrustManager(String id,
                int flag)Constructor to create a class instance initiated with the given logging identifier and trust management flag. | |
| SSLTrustManager(String id,
                Principal[] acceptedSubjects)Constructor to create a class instance initiated with the given loggin identifier and set of subjects to accept during trust checks. | |
| Method Summary | |
|  void | checkClientTrusted(X509Certificate[] chain,
                   String authType)This Method implements checkClientTrusted()method fromX509TrustManager. | 
|  void | checkServerTrusted(X509Certificate[] chain,
                   String authType)This Method implements checkServerTrusted()method fromX509TrustManager. | 
| protected  void | checkTrusted(X509Certificate[] chain,
             String authType)This Method implements checkServerTrusted()method fromX509TrustManager. | 
|  X509Certificate[] | getAcceptedIssuers()Returns a chain of trusted X509Certificatesfrom 
 the Keymaster. | 
|  Principal[] | getAcceptedSubjects()Returns trusted certificate subjects DN as restriction in addition to the accepted issuers list. | 
| private  KeyMaster | getKeyMaster()Returns a reference to the key master. | 
|  int | getTrustManagementType()Returns the type of trust manangement checks made. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
private static Logger log_
Logger instance for this class
public static final int NO_TRUST_CHECK
checkClientTrusted
 or checkServerTrusted is called. Neither the given
 certificate chain is verified.
public static final int ISSUER_TRUST_CHECK
checkClientTrusted or checkServerTrusted
 is called, the given certificate chain is verified and the root CA
 certificate is validated against the trusted certificates of the 
 KeyMaster.
public static final int SUBJECT_TRUST_CHECK
flag_ is
 ISSUER_TRUST_CHECK, the subject DN of the given 
 certificate is compared against a given set of 
 acceptedSubjects_.
public static final String AUTH_TYPE
private Object lock_
private KeyMaster keymaster_
KeyMaster.
private Set acceptedSubjects_
checkClientTrusted 
 resp. checkClientTrusted, 
 iff this set is null, or the 
 corresponding subject DN is element of this set.
private long lastFetch_
private String id_
protected int flag_
checkClientTrusted or checkClientTrusted
 is called.
| Constructor Detail | 
public SSLTrustManager()
SSLMasterImpl.DEFAULT_ID 
 and ISSUER_TRUST_CHECK are used for the 
 created class instance.
public SSLTrustManager(String id,
                       int flag)
NO_TRUST_CHECK,
 ISSUER_TRUST_CHECK.
id - logging identifier.flag - trust management flag.
public SSLTrustManager(String id,
                       Principal[] acceptedSubjects)
SUBJECT_TRUST_CHECK.
id - logging indentifier.acceptedSubjects - the subject DNs to accept during trust checks.| Method Detail | 
private KeyMaster getKeyMaster()
KeyMaster.public int getTrustManagementType()
public Principal[] getAcceptedSubjects()
null, 
   if there is no restriction according to the certificates subject DN.public X509Certificate[] getAcceptedIssuers()
X509Certificates from 
 the Keymaster. It implements getAcceptedIssuers() from
 X509TrustManager.
getAcceptedIssuers in interface X509TrustManagerX509Certificate.
public void checkClientTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
checkClientTrusted() method from 
 X509TrustManager. To verify the client certificate
 chain the checkServerTrusted method is called.
checkClientTrusted in interface X509TrustManagerchain - X509Certificate chain to be verified.authType - authorisation type
CertificateException - if the certificate chain is not 
   trusted by this TrustManager
public void checkServerTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
checkServerTrusted() method from 
 X509TrustManager. To verify the server certificate
 chain the KeyMaster is used.
checkServerTrusted in interface X509TrustManagerchain - X509Certificate chain to be verified.
CertificateException - if the certificate chain is not 
   trusted by this TrustManager
protected void checkTrusted(X509Certificate[] chain,
                            String authType)
                     throws CertificateException
checkServerTrusted() method from 
 X509TrustManager. To verify the server certificate
 chain and validate root CA issuer the KeyMaster is used.
chain - X509Certificate chain to be verified.
CertificateException - if the certificate chain is not 
   trusted by this TrustManager| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||