Package host.anzo.simon.ssl
Class DefaultSslContextFactory
java.lang.Object
host.anzo.simon.ssl.DefaultSslContextFactory
- All Implemented Interfaces:
SslContextFactory
A default implementation for a SSL powered SIMON communication.
All that is needed is a keystore and the corresponding password to access it.
All that is needed is a keystore and the corresponding password to access it.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSslContextFactory(InputStream keystoreStream, String keystorePass) Sets the needed information for creating theSSLContextDefaultSslContextFactory(String pathToKeystore, String keystorePass) Sets the needed information for creating theSSLContext -
Method Summary
Modifier and TypeMethodDescriptionGets theSSLContextwhich is used by SIMON to create a SSL powered link
-
Constructor Details
-
DefaultSslContextFactory
public DefaultSslContextFactory(String pathToKeystore, String keystorePass) throws NoSuchAlgorithmException, FileNotFoundException, KeyStoreException, CertificateException, IOException, UnrecoverableKeyException, KeyManagementException Sets the needed information for creating theSSLContext- Parameters:
pathToKeystore- the path to the keystore file for the serverkeystorePass- the password needed to access the keystore- Throws:
NoSuchAlgorithmException- if no Provider supports a TLSIOException- if there's a problem while readinting the keystorefileCertificateException- if any of the certificates in the keystore could not be loadedKeyStoreException- if no Provider supports a KeyStoreSpi implementation for the default keystore type (see: KeyStore.getDefaultType())FileNotFoundException- if the keystore file was not foundUnrecoverableKeyExceptionKeyManagementException- if initializing the context fails
-
DefaultSslContextFactory
public DefaultSslContextFactory(InputStream keystoreStream, String keystorePass) throws NoSuchAlgorithmException, FileNotFoundException, KeyStoreException, CertificateException, IOException, UnrecoverableKeyException, KeyManagementException Sets the needed information for creating theSSLContext- Parameters:
keystoreStream- an inputstream for reading the keystorekeystorePass- the password needed to access the keystore- Throws:
NoSuchAlgorithmException- if no Provider supports a TLSIOException- if there's a problem while readinting the keystorefileCertificateException- if any of the certificates in the keystore could not be loadedKeyStoreException- if no Provider supports a KeyStoreSpi implementation for the default keystore type (see: KeyStore.getDefaultType())FileNotFoundException- if the keystore file was not foundUnrecoverableKeyExceptionKeyManagementException- if initializing the context fails
-
-
Method Details
-
getSslContext
Description copied from interface:SslContextFactoryGets theSSLContextwhich is used by SIMON to create a SSL powered link- Specified by:
getSslContextin interfaceSslContextFactory- Returns:
- a ssl context object
-