Package com.unboundid.util.ssl
Class ValidityDateTrustManager
java.lang.Object
com.unboundid.util.ssl.ValidityDateTrustManager
- All Implemented Interfaces:
TrustManager,X509TrustManager
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class ValidityDateTrustManager
extends Object
implements X509TrustManager
This class provides an SSL trust manager that merely checks to see whether
a presented certificate is currently within its validity time window (i.e.,
the current time is not earlier than the certificate's notBefore timestamp
and not later than the certificate's notAfter timestamp).
Note that no other elements of the certificate are examined, so it is strongly recommended that this trust manager be used in an
Note that no other elements of the certificate are examined, so it is strongly recommended that this trust manager be used in an
AggregateTrustManager in conjunction with other trust managers that
perform other forms of validation.-
Constructor Summary
Constructors -
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.Retrieves the accepted issuer certificates for this trust manager.
-
Constructor Details
-
ValidityDateTrustManager
public ValidityDateTrustManager()Creates a new validity date trust manager.
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(@NotNull X509Certificate[] chain, @NotNull String authType) throws CertificateException Checks to determine whether the provided client certificate chain should be trusted.- 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(@NotNull X509Certificate[] chain, @NotNull String authType) throws CertificateException Checks to determine whether the provided server certificate chain should be trusted.- 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.
-