@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class TLSCipherSuiteSelector extends CommandLineTool
PROPERTY_ALLOW_SSL_PREFIX
system
property is set to true
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_ALLOW_RSA_KEY_EXCHANGE
The name of a system property
(com.unboundid.util.ssl.TLSCipherSuiteSelector.allowRSAKeyExchange) that
can be used to indicate whether to recommend cipher suites that use the RSA
key exchange algorithm.
|
static java.lang.String |
PROPERTY_ALLOW_SHA_1
The name of a system property
(com.unboundid.util.ssl.TLSCipherSuiteSelector.allowSHA1) that can be used
to indicate whether to recommend cipher suites that use the SHA-1 digest
algorithm.
|
static java.lang.String |
PROPERTY_ALLOW_SSL_PREFIX
The name of a system property
(com.unboundid.util.ssl.TLSCipherSuiteSelector.allowSSLPrefix) that can be
used to indicate whether to recommend cipher suites that use a prefix of
"SSL_" rather than "TLS_".
|
Constructor and Description |
---|
TLSCipherSuiteSelector(java.io.OutputStream out,
java.io.OutputStream err)
Creates a new instance of this TLS cipher suite selector that will use the
provided output streams.
|
TLSCipherSuiteSelector(java.io.OutputStream out,
java.io.OutputStream err,
boolean useJVMDefaults)
Creates a new instance of this TLS cipher suite selector that will use the
provided output streams.
|
Modifier and Type | Method and Description |
---|---|
void |
addToolArguments(ArgumentParser parser)
Adds the command-line arguments supported for use with this tool to the
provided argument parser.
|
static boolean |
allowRSAKeyExchange()
Indicates whether cipher suites that use the RSA key exchange algorithm
should be recommended by default.
|
static boolean |
allowSHA1()
Indicates whether cipher suites that use the SHA-1 digest algorithm should
be recommended by default.
|
static boolean |
allowSSLPrefixedSuites()
Indicates whether cipher suites whose names start with "SSL_" should be
recommended by default.
|
ResultCode |
doToolProcessing()
Performs the core set of processing for this tool.
|
static java.util.SortedSet<java.lang.String> |
getDefaultCipherSuites()
Retrieves the set of TLS cipher suites enabled by default in the JVM.
|
static java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> |
getNonRecommendedCipherSuites()
Retrieves a map containing the TLS cipher suites that are supported by the
JVM but are not recommended for use.
|
static java.lang.String[] |
getRecommendedCipherSuiteArray()
Retrieves an array containing the recommended set of TLS cipher suites as
selected by this class.
|
static java.util.SortedSet<java.lang.String> |
getRecommendedCipherSuites()
Retrieves the recommended set of TLS cipher suites as selected by this
class.
|
static java.util.SortedSet<java.lang.String> |
getSupportedCipherSuites()
Retrieves the set of all TLS cipher suites supported by the JVM.
|
java.lang.String |
getToolDescription()
Retrieves a human-readable description for this tool.
|
java.lang.String |
getToolName()
Retrieves the name of this tool.
|
java.lang.String |
getToolVersion()
Retrieves a version string for this tool, if available.
|
static ResultCode |
main(java.io.OutputStream out,
java.io.OutputStream err,
java.lang.String... args)
Invokes this command-line program with the provided set of arguments.
|
static void |
main(java.lang.String... args)
Invokes this command-line program with the provided set of arguments.
|
static void |
recompute()
Re-computes the default instance of this cipher suite selector.
|
static java.util.Set<java.lang.String> |
selectSupportedCipherSuites(java.util.Collection<java.lang.String> potentialSuiteNames)
Filters the provided collection of potential cipher suite names to retrieve
a set of the suites that are supported by the JVM.
|
static void |
setAllowRSAKeyExchange(boolean allowRSAKeyExchange)
Specifies whether cipher suites that use the RSA key exchange algorithm
should be recommended by default.
|
static void |
setAllowSHA1(boolean allowSHA1)
Specifies whether cipher suites that use the SHA-1 digest algorithm should
be recommended by default.
|
static void |
setAllowSSLPrefixedSuites(boolean allowSSLPrefix)
Specifies whether cipher suites whose names start with "SSL_" should be
recommended by default.
|
addEnableSSLDebuggingArgument, createArgumentParser, defaultsToInteractiveMode, doExtendedArgumentValidation, doShutdownHookProcessing, err, getAdditionalDescriptionParagraphs, getErr, getExampleUsages, getMaxTrailingArguments, getMinTrailingArguments, getOriginalErr, getOriginalOut, getOut, getPasswordFileReader, getToolCompletionMessage, getTrailingArgumentsPlaceholder, logToolInvocationByDefault, out, registerShutdownHook, requestToolArgumentsInteractively, runTool, supportsDebugLogging, supportsInteractiveMode, supportsOutputFile, supportsPropertiesFile, wrapErr, wrapOut
@NotNull public static final java.lang.String PROPERTY_ALLOW_RSA_KEY_EXCHANGE
setAllowRSAKeyExchange(boolean)
method.@NotNull public static final java.lang.String PROPERTY_ALLOW_SHA_1
setAllowSHA1(boolean)
method.@NotNull public static final java.lang.String PROPERTY_ALLOW_SSL_PREFIX
public TLSCipherSuiteSelector(@Nullable java.io.OutputStream out, @Nullable java.io.OutputStream err)
out
- The output stream to use for standard output. It may be
null
if standard output should be suppressed.err
- The output stream to use for standard error. It may be
null
if standard error should be suppressed.public TLSCipherSuiteSelector(@Nullable java.io.OutputStream out, @Nullable java.io.OutputStream err, boolean useJVMDefaults)
out
- The output stream to use for standard output. It
may be null
if standard output should be
suppressed.err
- The output stream to use for standard error. It
may be null
if standard error should be
suppressed.useJVMDefaults
- Indicates whether to use the JVM-default settings.
This should only be true
for the initial
instance created before the static initializer has
run.public static void main(@NotNull java.lang.String... args)
args
- The command-line arguments provided to this program.@NotNull public static ResultCode main(@Nullable java.io.OutputStream out, @Nullable java.io.OutputStream err, @NotNull java.lang.String... args)
out
- The output stream to use for standard output. It may be
null
if standard output should be suppressed.err
- The output stream to use for standard error. It may be
null
if standard error should be suppressed.args
- The command-line arguments provided to this program.@NotNull public static java.util.SortedSet<java.lang.String> getSupportedCipherSuites()
TLSCipherSuiteComparator
.@NotNull public static java.util.SortedSet<java.lang.String> getDefaultCipherSuites()
TLSCipherSuiteComparator
.@NotNull public static java.util.SortedSet<java.lang.String> getRecommendedCipherSuites()
TLSCipherSuiteComparator
.@NotNull public static java.lang.String[] getRecommendedCipherSuiteArray()
TLSCipherSuiteComparator
.@NotNull public static java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> getNonRecommendedCipherSuites()
TLSCipherSuiteComparator
.
Each TLS cipher suite name will be mapped to a list of the reasons it is
not recommended for use.@NotNull public java.lang.String getToolName()
getToolName
in class CommandLineTool
@NotNull public java.lang.String getToolDescription()
CommandLineTool.getAdditionalDescriptionParagraphs()
method should be used to
return the text for the subsequent paragraphs.getToolDescription
in class CommandLineTool
@NotNull public java.lang.String getToolVersion()
getToolVersion
in class CommandLineTool
null
if none is
available.public void addToolArguments(@NotNull ArgumentParser parser) throws ArgumentException
addToolArguments
in class CommandLineTool
parser
- The argument parser to which the arguments are to be added.ArgumentException
- If a problem occurs while adding any of the
tool-specific arguments to the provided
argument parser.@NotNull public ResultCode doToolProcessing()
doToolProcessing
in class CommandLineTool
@NotNull public static java.util.Set<java.lang.String> selectSupportedCipherSuites(@Nullable java.util.Collection<java.lang.String> potentialSuiteNames)
potentialSuiteNames
- The collection of cipher suite names to be
filtered.public static boolean allowRSAKeyExchange()
true
if cipher suites that use the RSA key exchange
algorithm should be recommended by default, or false
if
not.public static void setAllowRSAKeyExchange(boolean allowRSAKeyExchange)
allowRSAKeyExchange
- Indicates whether cipher suites that use the
RSA key exchange algorithm should be
recommended by default.public static boolean allowSHA1()
true
if cipher suites that use the SHA-1 digest algorithm
should be recommended by default, or false
if not.public static void setAllowSHA1(boolean allowSHA1)
allowSHA1
- Indicates whether cipher suites that use the SHA-1
digest algorithm should be recommended by default.public static boolean allowSSLPrefixedSuites()
true
if cipher suites prefixed with either "SSL_" or
"TLS_" should be recommended by default, or false
if only
suites prefixed with "TLS_" should be recommended by default.public static void setAllowSSLPrefixedSuites(boolean allowSSLPrefix)
allowSSLPrefix
- Indicates whether cipher suites whose names start
with "SSL_" should be recommended by default. If
this is true
, then suites prefixed with
either "TLS_" or "SSL_" may be recommended. If
this is false
, then only suites prefixed
with "TLS_" may be recommended.public static void recompute()