public class CipherFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_LEGACY_ALGORITHMS
The value of "jdk.tls.legacyAlgorithms" security
property at the time of class initialization.
|
static String |
KEYSTORE_PASSWORD
The default password to use for the .h2.keystore file
|
static String |
LEGACY_ALGORITHMS_SECURITY_KEY
The security property which can prevent anonymous TLS connections.
|
Modifier and Type | Method and Description |
---|---|
static ServerSocket |
createServerSocket(int port,
InetAddress bindAddress)
Create a secure server socket.
|
static Socket |
createSocket(InetAddress address,
int port)
Create a secure client socket that is connected to the given address and
port.
|
static BlockCipher |
getBlockCipher(String algorithm)
Get a new block cipher object for the given algorithm.
|
static KeyStore |
getKeyStore(String password)
Get the keystore object using the given password.
|
static String |
getLegacyAlgorithmsSilently()
Returns the security property "jdk.tls.legacyAlgorithms".
|
static void |
removeAnonFromLegacyAlgorithms()
Attempts to weaken the security properties to allow anonymous TLS.
|
static String |
removeDhAnonFromCommaSeparatedList(String list)
Removes DH_anon and ECDH_anon from a comma separated list of ciphers.
|
static void |
resetDefaultLegacyAlgorithms()
Attempts to resets the security property to the default value.
|
public static final String KEYSTORE_PASSWORD
public static final String LEGACY_ALGORITHMS_SECURITY_KEY
public static final String DEFAULT_LEGACY_ALGORITHMS
public static BlockCipher getBlockCipher(String algorithm)
algorithm
- the algorithmpublic static Socket createSocket(InetAddress address, int port) throws IOException
address
- the address to connect toport
- the portIOException
public static ServerSocket createServerSocket(int port, InetAddress bindAddress) throws IOException
port
- the port to listen onbindAddress
- the address to bind to, or null to bind to all
addressesIOException
removeAnonFromLegacyAlgorithms()
public static String removeDhAnonFromCommaSeparatedList(String list)
list
- a list of names separated by commas (and spaces)public static void removeAnonFromLegacyAlgorithms()
NOTE: In current (as of 2016) default implementations of JSSE which use this security property, the value is permanently cached inside the ServerHandshake class upon its first use. Therefore the modification accomplished by this method has to be done before the first use of a server SSL socket. Later changes to this property will not have any effect on server socket behavior.
public static void resetDefaultLegacyAlgorithms()
NOTE: Resetting the property might not have any effect on server socket behavior.
removeAnonFromLegacyAlgorithms()
public static String getLegacyAlgorithmsSilently()
public static KeyStore getKeyStore(String password) throws IOException
password
- the keystore passwordIOException
Copyright © 2020 JBoss by Red Hat. All rights reserved.