net.kwfgrid.gwes.client
Class CertUtils
java.lang.Object
net.kwfgrid.gwes.client.CertUtils
- All Implemented Interfaces:
- TrustManager, X509TrustManager
public class CertUtils
- extends Object
- implements X509TrustManager
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.