@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class PEMFileTrustManager extends java.lang.Object implements javax.net.ssl.X509TrustManager, java.io.Serializable
Constructor and Description |
---|
PEMFileTrustManager(java.io.File... pemFiles)
Creates a new PEM file trust manager that will read trusted certificate
information from the specified PEM files.
|
PEMFileTrustManager(java.util.List<java.io.File> pemFiles)
Creates a new PEM file trust manager that will read trusted certificate
information from the specified PEM files.
|
Modifier and Type | Method and Description |
---|---|
void |
checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Determines whether the provided client certificate chain should be
considered trusted based on the trusted certificate information read from
PEM files.
|
void |
checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
Determines whether the provided server certificate chain should be
considered trusted based on the trusted certificate information read from
PEM files.
|
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
Retrieves an array of the issuer certificates that will be considered
trusted.
|
public PEMFileTrustManager(@NotNull java.io.File... pemFiles) throws java.security.KeyStoreException
pemFiles
- The PEM files from which to read the trusted certificate
information. It must not be null
or empty, and
all files must exist. Each element may be a file (which
may contain one or more PEM-formatted certificates) or a
directory (in which case all of the files in that
directory, including subdirectories will be recursively
processed).java.security.KeyStoreException
- If a problem occurs while trying to read or
decode any of the certificates.public PEMFileTrustManager(@NotNull java.util.List<java.io.File> pemFiles) throws java.security.KeyStoreException
pemFiles
- The PEM files from which to read the trusted certificate
information. It must not be null
or empty, and
all files must exist. Each element may be a file (which
may contain one or more PEM-formatted certificates) or a
directory (in which case all of the files in that
directory, including subdirectories will be recursively
processed).java.security.KeyStoreException
- If a problem occurs while trying to read or
decode any of the 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. It must not be null
or empty.authType
- The type of authentication to use based on the client
certificate. It must not be null
.java.security.cert.CertificateException
- If the provided certificate chain should not
be considered 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. It must not be null
or empty.authType
- The type of authentication to use based on the server
certificate. It must not be null
.java.security.cert.CertificateException
- If the provided certificate chain should not
be considered trusted.@NotNull public java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface javax.net.ssl.X509TrustManager