Package org.h2.security

# Class CipherFactory

java.lang.Object
org.h2.security.CipherFactory

public class CipherFactory extends Object
A factory to create new block cipher objects.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`KEYSTORE_PASSWORD`
The default password to use for the .h2.keystore file

## Method Summary

Modifier and Type
Method
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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### KEYSTORE_PASSWORD

public static final String KEYSTORE_PASSWORD
The default password to use for the .h2.keystore file

See Also:
  - Constant Field Values

## Method Details

### getBlockCipher

public static BlockCipher getBlockCipher(String algorithm)
Get a new block cipher object for the given algorithm.

Parameters:
  `algorithm` - the algorithm
Returns:
  a new cipher object

### createSocket

public static Socket createSocket(InetAddress address, int port) throws IOException
Create a secure client socket that is connected to the given address and port.

Parameters:
  `address` - the address to connect to
  `port` - the port
Returns:
  the socket
Throws:
  `IOException` - on failure

### createServerSocket

public static ServerSocket createServerSocket(int port, InetAddress bindAddress) throws IOException
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 on
  `bindAddress` - the address to bind to, or null to bind to all addresses
Returns:
  the server socket
Throws:
  `IOException` - on failure

### getKeyStore

public static KeyStore getKeyStore(String password) throws IOException
Get the keystore object using the given password.

Parameters:
  `password` - the keystore password
Returns:
  the keystore
Throws:
  `IOException` - on failure