|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.admin.ads.util.ApplicationTrustManager
public class ApplicationTrustManager
This class is in charge of checking whether the certificates that are presented are trusted or not. This implementation tries to check also that the subject DN of the certificate corresponds to the host passed using the setHostName method. The constructor tries to use a default TrustManager from the system and if it cannot be retrieved this class will only accept the certificates explicitly accepted by the user (and specified by calling acceptCertificate). NOTE: this class is not aimed to be used when we have connections in paralel.
Nested Class Summary | |
---|---|
static class |
ApplicationTrustManager.Cause
The enumeration for the different causes for which the trust manager can refuse to accept a certificate. |
Constructor Summary | |
---|---|
ApplicationTrustManager(java.security.KeyStore keystore)
The default constructor. |
Method Summary | |
---|---|
void |
acceptCertificate(java.security.cert.X509Certificate[] chain,
java.lang.String authType,
java.lang.String host)
This method is called when the user accepted a certificate. |
void |
checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
|
void |
checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
|
ApplicationTrustManager |
createCopy()
Creates a copy of this ApplicationTrustManager. |
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
|
java.lang.String |
getLastRefusedAuthType()
Returns the authentication type for the last refused certificate. |
ApplicationTrustManager.Cause |
getLastRefusedCause()
Returns the last cause for refusal of a certificate. |
java.security.cert.X509Certificate[] |
getLastRefusedChain()
Returns the certificate chain for the last refused certificate. |
void |
resetLastRefusedItems()
This is a method used to set to null the different members that provide information about the last refused certificate. |
void |
setHost(java.lang.String host)
Sets the host name we are trying to contact in a secure mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ApplicationTrustManager(java.security.KeyStore keystore)
keystore
- The keystore to use for this trustmanager.Method Detail |
---|
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateException
checkClientTrusted
in interface javax.net.ssl.X509TrustManager
java.security.cert.CertificateException
public void checkServerTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType) throws java.security.cert.CertificateException
checkServerTrusted
in interface javax.net.ssl.X509TrustManager
java.security.cert.CertificateException
public java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface javax.net.ssl.X509TrustManager
public void acceptCertificate(java.security.cert.X509Certificate[] chain, java.lang.String authType, java.lang.String host)
chain
- the certificate chain accepted by the user.authType
- the authentication type.host
- the host we tried to connect and that presented the
certificate.public void setHost(java.lang.String host)
host
- the host name we are trying to contact in a secure mode.public void resetLastRefusedItems()
public ApplicationTrustManager createCopy()
public java.lang.String getLastRefusedAuthType()
public ApplicationTrustManager.Cause getLastRefusedCause()
public java.security.cert.X509Certificate[] getLastRefusedChain()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |