@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class TopologyRegistryTrustManager extends java.lang.Object implements javax.net.ssl.X509TrustManager, java.io.Serializable
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only
supported for use against Ping Identity, UnboundID, and
Nokia/Alcatel-Lucent 8661 server products. These classes provide support
for proprietary functionality or for external specifications that are not
considered stable or mature enough to be guaranteed to work in an
interoperable way with other types of LDAP servers.
Constructor and Description |
---|
TopologyRegistryTrustManager(java.io.File configurationFile,
long cacheDurationMillis)
Creates a new instance of this trust manager with the provided settings.
|
TopologyRegistryTrustManager(TopologyRegistryTrustManagerProperties properties)
Creates a new instance of this trust manager with the provided properties.
|
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.
|
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
Retrieves the accepted issuer certificates for this trust manager.
|
long |
getCacheDurationMillis()
Retrieves the maximum length of time in milliseconds that cached topology
registry information should be considered valid.
|
java.io.File |
getConfigurationFile()
Retrieves the server configuration file from which the topology registry
certificates will be read.
|
boolean |
ignoreIssuerCertificateValidityWindow()
Indicates whether to ignore the validity window for issuer certificates
when determining whether to trust a certificate chain.
|
boolean |
ignorePeerCertificateValidityWindow()
Indicates whether to ignore the validity window for the peer certificate
when determining whether to trust a certificate chain.
|
boolean |
requirePeerCertificateInTopologyRegistry()
Indicates whether to require the peer certificate itself to be included in
the topology registry for a certificate chain to be trusted.
|
java.lang.String |
toString()
Retrieves a string representation of this topology registry trust manager
instance.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this topology registry trust manager
instance to the given buffer.
|
public TopologyRegistryTrustManager(@NotNull java.io.File configurationFile, long cacheDurationMillis)
configurationFile
- The configuration file for the Ping Identity
Directory Server instance that holds the
topology registry data. It must not be
null
.cacheDurationMillis
- The maximum length of time in milliseconds
that previously loaded certificates may be
cached. If this is less than or equal to
zero, then certificates will not be cached.public TopologyRegistryTrustManager(@NotNull TopologyRegistryTrustManagerProperties properties)
properties
- The properties to use to create this trust manager.
It must not be null
.@NotNull public java.io.File getConfigurationFile()
public long getCacheDurationMillis()
public boolean requirePeerCertificateInTopologyRegistry()
true
if a certificate chain may only be trusted if the
topology registry includes the peer certificate itself, or
false
if a certificate chain may be trusted if the
topology registry contains the peer certificate or any of its
issuers.public boolean ignorePeerCertificateValidityWindow()
true
if a certificate chain may be considered trusted
even if the current time is outside the peer certificate's
validity window, or false
if a certificate chain may only
be considered trusted if the current time is between the
notBefore
and notAfter
timestamps for the peer
certificate.public boolean ignoreIssuerCertificateValidityWindow()
true
if a certificate chain may be considered trusted
even if the current time is outside the any issuer certificate's
validity window, or false
if a certificate chain may only
be considered trusted if the current time is between the
notBefore
and notAfter
timestamps for all issuer
certificates.public void checkClientTrusted(@NotNull java.security.cert.X509Certificate[] chain, @NotNull java.lang.String authType) throws java.security.cert.CertificateException
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
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
@NotNull public java.lang.String toString()
toString
in class java.lang.Object