Package org.h2.security
Class CipherFactory
- java.lang.Object
-
- org.h2.security.CipherFactory
-
public class CipherFactory extends java.lang.ObjectA factory to create new block cipher objects.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEYSTORE_PASSWORDThe default password to use for the .h2.keystore file
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.net.ServerSocketcreateServerSocket(int port, java.net.InetAddress bindAddress)Create a secure server socket.static java.net.SocketcreateSocket(java.net.InetAddress address, int port)Create a secure client socket that is connected to the given address and port.static BlockCiphergetBlockCipher(java.lang.String algorithm)Get a new block cipher object for the given algorithm.static java.security.KeyStoregetKeyStore(java.lang.String password)Get the keystore object using the given password.
-
-
-
Field Detail
-
KEYSTORE_PASSWORD
public static final java.lang.String KEYSTORE_PASSWORD
The default password to use for the .h2.keystore file- See Also:
- Constant Field Values
-
-
Method Detail
-
getBlockCipher
public static BlockCipher getBlockCipher(java.lang.String algorithm)
Get a new block cipher object for the given algorithm.- Parameters:
algorithm- the algorithm- Returns:
- a new cipher object
-
createSocket
public static java.net.Socket createSocket(java.net.InetAddress address, int port) throws java.io.IOExceptionCreate a secure client socket that is connected to the given address and port.- Parameters:
address- the address to connect toport- the port- Returns:
- the socket
- Throws:
java.io.IOException- on failure
-
createServerSocket
public static java.net.ServerSocket createServerSocket(int port, java.net.InetAddress bindAddress) throws java.io.IOExceptionCreate a secure server socket. If a bind address is specified, the socket is only bound to this address.- Parameters:
port- the port to listen onbindAddress- the address to bind to, or null to bind to all addresses- Returns:
- the server socket
- Throws:
java.io.IOException- on failure
-
getKeyStore
public static java.security.KeyStore getKeyStore(java.lang.String password) throws java.io.IOExceptionGet the keystore object using the given password.- Parameters:
password- the keystore password- Returns:
- the keystore
- Throws:
java.io.IOException- on failure
-
-