Package net.i2p.sam.client
Class SSLUtil
- java.lang.Object
-
- net.i2p.sam.client.SSLUtil
-
class SSLUtil extends Object
Utilities for SAM SSL server sockets.- Since:
- 0.9.24 copied from net.i2p.sam for testing SSL stream forwarding
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_SAMCLIENT_CONFIGFILE
-
Constructor Summary
Constructors Constructor Description SSLUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SSLServerSocketFactory
initializeFactory(Properties opts)
Sets up the SSLContext and sets the socket factory.static boolean
verifyKeyStore(Properties opts)
Create a new selfsigned cert and keystore and pubkey cert if they don't exist.
-
-
-
Field Detail
-
DEFAULT_SAMCLIENT_CONFIGFILE
public static final String DEFAULT_SAMCLIENT_CONFIGFILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
verifyKeyStore
public static boolean verifyKeyStore(Properties opts) throws IOException
Create a new selfsigned cert and keystore and pubkey cert if they don't exist. May take a while.- Parameters:
opts
- in/out, updated if rv is true- Returns:
- false if it already exists; if true, caller must save opts
- Throws:
IOException
- on creation fail
-
initializeFactory
public static SSLServerSocketFactory initializeFactory(Properties opts) throws IOException
Sets up the SSLContext and sets the socket factory. No option prefix allowed.- Returns:
- factory, throws on all errors
- Throws:
IOException
- GeneralSecurityExceptions are wrapped in IOE for convenience
-
-