net.kwfgrid.gwes.client
Class CertUtils

java.lang.Object
  extended by net.kwfgrid.gwes.client.CertUtils
All Implemented Interfaces:
TrustManager, X509TrustManager

public class CertUtils
extends Object
implements X509TrustManager


Method Summary
 void checkClientTrusted(X509Certificate[] chain, String authType)
           
 void checkServerTrusted(X509Certificate[] chain, String authType)
           
 X509Certificate[] getAcceptedIssuers()
           
static CertUtils getInstance()
          Get a singleton of CertUtils.
 boolean installCert(String host, int port)
          Returns true if some certificate has been installed, false otherwise.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CertUtils getInstance()
                             throws IOException,
                                    NoSuchAlgorithmException,
                                    KeyManagementException,
                                    KeyStoreException,
                                    CertificateException
Get a singleton of CertUtils.

Returns:
Throws:
IOException
NoSuchAlgorithmException
KeyManagementException
KeyStoreException
CertificateException

installCert

public boolean installCert(String host,
                           int port)
                    throws NoSuchAlgorithmException,
                           KeyStoreException,
                           IOException,
                           KeyManagementException,
                           CertificateException
Returns true if some certificate has been installed, false otherwise.

Parameters:
host -
port -
Returns:
Throws:
NoSuchAlgorithmException
KeyStoreException
IOException
KeyManagementException
CertificateException

getAcceptedIssuers

public X509Certificate[] getAcceptedIssuers()
Specified by:
getAcceptedIssuers in interface X509TrustManager

checkClientTrusted

public void checkClientTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
Specified by:
checkClientTrusted in interface X509TrustManager
Throws:
CertificateException

checkServerTrusted

public void checkServerTrusted(X509Certificate[] chain,
                               String authType)
                        throws CertificateException
Specified by:
checkServerTrusted in interface X509TrustManager
Throws:
CertificateException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception


Copyright © 2005-2011 Fraunhofer FIRST. All Rights Reserved.