Package org.h2.security
Class CipherFactory
java.lang.Object
org.h2.security.CipherFactory
A factory to create new block cipher objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe default password to use for the .h2.keystore file -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerSocketcreateServerSocket(int port, InetAddress bindAddress) Create a secure server socket.static SocketcreateSocket(InetAddress address, int port) Create a secure client socket that is connected to the given address and port.static BlockCiphergetBlockCipher(String algorithm) Get a new block cipher object for the given algorithm.static KeyStoregetKeyStore(String password) Get the keystore object using the given password.
-
Field Details
-
KEYSTORE_PASSWORD
The default password to use for the .h2.keystore file- See Also:
-
-
Method Details
-
getBlockCipher
Get a new block cipher object for the given algorithm.- Parameters:
algorithm- the algorithm- Returns:
- a new cipher object
-
createSocket
Create 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:
IOException- on failure
-
createServerSocket
Create 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:
IOException- on failure
-
getKeyStore
Get the keystore object using the given password.- Parameters:
password- the keystore password- Returns:
- the keystore
- Throws:
IOException- on failure
-