Package io.jans.net
Class TrustAllTrustManager
java.lang.Object
io.jans.net.TrustAllTrustManager
- All Implemented Interfaces:
Serializable,TrustManager,X509TrustManager
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] chain, String authType) Checks to determine whether the provided client certificate chain should be trusted.voidcheckServerTrusted(X509Certificate[] chain, String authType) Checks to determine whether the provided server certificate chain should be trusted.booleanIndicate whether to reject certificates if the current time is outside the validity window for the certificate.Retrieves the accepted issuer certificates for this trust manager.
-
Constructor Details
-
TrustAllTrustManager
public 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
public 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.- Parameters:
examineValidityDates- Indicates whether to reject certificates if the current time is outside the validity window for the certificate.
-
-
Method Details
-
examineValidityDates
public boolean examineValidityDates()Indicate whether to reject certificates if the current time is outside the validity window for the certificate.- Returns:
trueif the certificate validity time should be examined and certificates should be rejected if they are expired or not yet valid, orfalseif certificates should be accepted even outside of the validity window.
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException Checks to determine whether the provided client certificate chain should be trusted. A certificate will only be rejected (by throwing aCertificateException) if certificate validity dates should be examined and the certificate or any of its issuers is outside of the validity window.- Specified by:
checkClientTrustedin interfaceX509TrustManager- Parameters:
chain- The client certificate chain for which to make the determination.authType- The authentication type based on the client certificate.- Throws:
CertificateException- If the provided client certificate chain should not be trusted.
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException Checks to determine whether the provided server certificate chain should be trusted. A certificate will only be rejected (by throwing aCertificateException) if certificate validity dates should be examined and the certificate or any of its issuers is outside of the validity window.- Specified by:
checkServerTrustedin interfaceX509TrustManager- Parameters:
chain- The server certificate chain for which to make the determination.authType- The key exchange algorithm used.- Throws:
CertificateException- If the provided server certificate chain should not be trusted.
-
getAcceptedIssuers
Retrieves the accepted issuer certificates for this trust manager. This will always return an empty array.- Specified by:
getAcceptedIssuersin interfaceX509TrustManager- Returns:
- The accepted issuer certificates for this trust manager.
-