public class CipherSuiteList
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
L_ALL
Selection constant for a list with all known cipher suites.
|
static int |
L_DEFAULT
Selection constant for a list with the default cipher suites.
|
static int |
L_IMPLEMENTED
Selection constant for a list with all implemented cipher suites.
|
static int |
L_NONE
Selection constant for an empty list.
|
Constructor and Description |
---|
CipherSuiteList()
Create an empty cipher suite list.
|
CipherSuiteList(CipherSuite suite)
Create a new cipher suite list with the specified suite as its only element.
|
CipherSuiteList(CipherSuite[] suites)
Create a new cipher suite list from the contents of the given array.
|
CipherSuiteList(CipherSuiteList suites)
Create a copy of the given cipher suite list.
|
CipherSuiteList(int which)
Create a new cipher suite list with the contents determined by the selection
value.
|
CipherSuiteList(java.lang.String[] suites)
Create a new cipher suite list from an array of cipher suite names.
|
Modifier and Type | Method and Description |
---|---|
void |
add(CipherSuite suite)
Add a cipher suite to the end of this list.
|
void |
add(CipherSuite[] suites)
Add all cipher suite from an array to this list in order.
|
void |
clear()
Remove all elements from this list.
|
java.lang.Object |
clone()
Return a clone of this cipher suite list.
|
boolean |
contains(CipherSuite suite)
Test if the given cipher suite is an element of this list.
|
boolean |
containsTLS13Suite()
Checks if this cipher suite list contains any TLS 1.3 suite.
|
CipherSuite |
elementAt(int i)
Return the element at the given index.
|
java.util.Enumeration |
elements()
Return an Enumeration of the elements of this list.
|
void |
ensureAvailable()
Make sure this list only contains cipher suites that can actually be
used.
|
boolean |
equals(java.lang.Object o)
Checks whether this cipher suite list is equal to the given object
|
int |
indexOf(CipherSuite suite)
Gets the index of the given cipher suite in this list.
|
void |
insertSorted(CipherSuite suite)
Perform a sorted insertion of the given cipher suite into this list.
|
void |
insertSorted(CipherSuite[] suites)
Perform a sorted insertion of the cipher suites from the given array into this
list.
|
void |
intersectWith(CipherSuiteList other)
Compute the intersection of this list and another list.
|
void |
remove(CipherSuite suite)
Remove a cipher suite from this list.
|
void |
remove(CipherSuite[] suites)
Remove all cipher suite from an array from this list.
|
int |
size()
Return the number of elements in this list.
|
void |
sort()
Sort the cipher suites by strength.
|
CipherSuite[] |
toArray()
Convert this list to an array of cipher suites.
|
java.lang.String |
toString()
Return a string representation of this list.
|
public static final int L_NONE
public static final int L_DEFAULT
public static final int L_IMPLEMENTED
public static final int L_ALL
public CipherSuiteList()
public CipherSuiteList(int which)
Note that ensureAvailable() is automatically called on the created list.
public CipherSuiteList(CipherSuite suite)
public CipherSuiteList(CipherSuite[] suites)
public CipherSuiteList(java.lang.String[] suites) throws java.lang.IllegalArgumentException
suites
- the cipher suite namesjava.lang.IllegalArgumentException
- if the list of suite names refers a
cipher suite that is not supportedpublic CipherSuiteList(CipherSuiteList suites)
public void add(CipherSuite suite)
public void remove(CipherSuite suite)
public boolean contains(CipherSuite suite)
public int indexOf(CipherSuite suite)
-1
if the suite is not included in
the listpublic void add(CipherSuite[] suites)
public void remove(CipherSuite[] suites)
public void clear()
public CipherSuite[] toArray()
public int size()
public CipherSuite elementAt(int i) throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
public java.util.Enumeration elements()
public void insertSorted(CipherSuite suite)
Cipher suites are sorted by cryptographic strength, the strongest come first. We define a cipher suite to be stronger than another by the following ordered criteria.
public void insertSorted(CipherSuite[] suites)
public void sort()
public void ensureAvailable()
CipherSuite.isAvailable()
public void intersectWith(CipherSuiteList other)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean containsTLS13Suite()
true
if any TLS 1.3 suite is included,
false
otherwisepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the other CipherSuiteListtrue
if the two lists are the same, false
if notpublic java.lang.String toString()
toString
in class java.lang.Object