java.lang.Object
net.i2p.sam.SSLUtil
Utilities for SAM SSL server sockets.
Constructor Summary
ConstructorsConstructorDescriptionSSLUtil()The keystore helpers and socket factories below are static, and the only fields are property-name constants, so an instance carries nothing.Method Summary
All MethodsModifier and TypeMethodDescriptionstatic SSLServerSocketFactoryinitializeFactory(Properties opts) Sets up the SSLContext and sets the socket factory.static booleanverifyKeyStore(Properties opts) Create a new selfsigned cert and keystore and pubkey cert if they don't exist.
Constructor Details
SSLUtil
SSLUtil()The keystore helpers and socket factories below are static, and the only fields are property-name constants, so an instance carries nothing.
Method Details
verifyKeyStore
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
Sets up the SSLContext and sets the socket factory. No option prefix allowed.- Parameters:
opts- the SAM properties naming the keystore and its passwords- Returns:
- factory, throws on all errors
- Throws:
IOException- GeneralSecurityExceptions are wrapped in IOE for convenience