@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class TrustAllTrustManager extends java.lang.Object implements javax.net.ssl.X509TrustManager, java.io.Serializable
Constructor and Description |
---|
TrustAllTrustManager()
Creates a new instance of this trust all trust manager that will trust
any certificate, including certificates that are expired or not yet valid.
|
TrustAllTrustManager(boolean examineValidityDates)
Creates a new instance of this trust all trust manager that will trust
any certificate, potentially excluding certificates that are expired or not
yet valid.
|
Modifier and Type | Method and Description |
---|---|
void |
checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Checks to determine whether the provided client certificate chain should be
trusted.
|
void |
checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Checks to determine whether the provided server certificate chain should be
trusted.
|
boolean |
examineValidityDates()
Indicate whether to reject certificates if the current time is outside the
validity window for the certificate.
|
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
Retrieves the accepted issuer certificates for this trust manager.
|
public TrustAllTrustManager()
public TrustAllTrustManager(boolean examineValidityDates)
examineValidityDates
- Indicates whether to reject certificates if
the current time is outside the validity
window for the certificate.public boolean examineValidityDates()
true
if the certificate validity time should be examined
and certificates should be rejected if they are expired or not
yet valid, or false
if certificates should be accepted
even outside of the validity window.public void checkClientTrusted(@NotNull java.security.cert.X509Certificate[] chain, @NotNull java.lang.String authType) throws java.security.cert.CertificateException
CertificateException
) if certificate validity dates should be
examined and the certificate or any of its issuers is outside of the
validity window.checkClientTrusted
in interface javax.net.ssl.X509TrustManager
chain
- The client certificate chain for which to make the
determination.authType
- The authentication type based on the client certificate.java.security.cert.CertificateException
- If the provided client certificate chain
should not be trusted.public void checkServerTrusted(@NotNull java.security.cert.X509Certificate[] chain, @NotNull java.lang.String authType) throws java.security.cert.CertificateException
CertificateException
) if certificate validity dates should be
examined and the certificate or any of its issuers is outside of the
validity window.checkServerTrusted
in interface javax.net.ssl.X509TrustManager
chain
- The server certificate chain for which to make the
determination.authType
- The key exchange algorithm used.java.security.cert.CertificateException
- If the provided server certificate chain
should not be trusted.@NotNull public java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface javax.net.ssl.X509TrustManager