|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwjhk.jupload2.upload.InteractiveTrustManager
public class InteractiveTrustManager
An implementation of X509TrustManager which can operate
in different modes. If mode is NONE, then any server certificate is
accepted and no certificate-based client authentication is performed. If mode
is SERVER, then server certificates are verified and if verification is
unsuccessful, a dialog is presented to the user, which allows accepting a
certificate temporarily or permanently. If mode is CLIENT, then
certificate-based client authentication is performed. Finally, there is a
mode STRICT, which combines both SERVER and CLIENT modes.
| Field Summary | |
|---|---|
static int |
CLIENT
Mode for using client certificates. |
static int |
NONE
Mode for accepting any certificate. |
static int |
SERVER
Mode for verifying server certificate chains. |
static int |
STRICT
Mode for performing both client authentication and server cert verification. |
| Constructor Summary | |
|---|---|
InteractiveTrustManager(UploadPolicy p,
String hostname,
String passwd)
Create a new instance. |
|
| Method Summary | |
|---|---|
void |
checkClientTrusted(X509Certificate[] arg0,
String arg1)
As this class is used on the client side only, The implementation of this method does nothing. |
void |
checkServerTrusted(X509Certificate[] chain,
String authType)
|
X509Certificate[] |
getAcceptedIssuers()
|
KeyManager[] |
getKeyManagers()
Retrieve key managers. |
X509TrustManager[] |
getTrustManagers()
Retrieve trust managers. |
void |
handle(Callback[] callbacks)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int SERVER
public static final int CLIENT
public static final int STRICT
| Constructor Detail |
|---|
public InteractiveTrustManager(UploadPolicy p,
String hostname,
String passwd)
throws NoSuchAlgorithmException,
KeyStoreException,
CertificateException,
IllegalArgumentException,
UnrecoverableKeyException
p - The UploadPolicy to use for this instance.hostname - passwd - An optional password for the truststore.
NoSuchAlgorithmException
KeyStoreException
CertificateException
IllegalArgumentException
UnrecoverableKeyException| Method Detail |
|---|
public void handle(Callback[] callbacks)
throws UnsupportedCallbackException
handle in interface CallbackHandlerUnsupportedCallbackExceptionCallbackHandler.handle(javax.security.auth.callback.Callback[])public KeyManager[] getKeyManagers()
public X509TrustManager[] getTrustManagers()
public void checkClientTrusted(X509Certificate[] arg0,
String arg1)
checkClientTrusted in interface X509TrustManagerX509TrustManager.checkClientTrusted(java.security.cert.X509Certificate[],
java.lang.String)
public void checkServerTrusted(X509Certificate[] chain,
String authType)
throws CertificateException
checkServerTrusted in interface X509TrustManagerCertificateExceptionX509TrustManager.checkServerTrusted(java.security.cert.X509Certificate[],
java.lang.String)public X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers in interface X509TrustManagerX509TrustManager.getAcceptedIssuers()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||