de.root1.simon.ssl
Class DefaultSslContextFactory

java.lang.Object
  extended by de.root1.simon.ssl.DefaultSslContextFactory
All Implemented Interfaces:
SslContextFactory

public class DefaultSslContextFactory
extends java.lang.Object
implements SslContextFactory

A default implementation for a SSL powered SIMON communication.
All that is needed is a keystore and the corresponding password to access it.

Version:
200901191432
Author:
Alexander Christian

Constructor Summary
DefaultSslContextFactory(java.lang.String pathToKeystore, java.lang.String keystorePass)
          Sets the needed information for creating the SSLContext
 
Method Summary
 javax.net.ssl.SSLContext getSslContext()
          Gets the SSLContext which is used by SIMON to create a SSL powered link
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSslContextFactory

public DefaultSslContextFactory(java.lang.String pathToKeystore,
                                java.lang.String keystorePass)
                         throws java.security.NoSuchAlgorithmException,
                                java.io.FileNotFoundException,
                                java.security.KeyStoreException,
                                java.security.cert.CertificateException,
                                java.io.IOException,
                                java.security.UnrecoverableKeyException,
                                java.security.KeyManagementException
Sets the needed information for creating the SSLContext

Parameters:
pathToKeystore - the path to the keystore file for the server
keystorePass - the password needed to access the keystore
Throws:
java.security.NoSuchAlgorithmException - if no Provider supports a TLS
java.io.IOException - if there's a problem while readinting the keystorefile
java.security.cert.CertificateException - if any of the certificates in the keystore could not be loaded
java.security.KeyStoreException - if no Provider supports a KeyStoreSpi implementation for the default keystore type (see: KeyStore.getDefaultType())
java.io.FileNotFoundException - if the keystore file was not found
java.security.UnrecoverableKeyException
java.security.KeyManagementException - if initializing the context fails
Method Detail

getSslContext

public javax.net.ssl.SSLContext getSslContext()
Description copied from interface: SslContextFactory
Gets the SSLContext which is used by SIMON to create a SSL powered link

Specified by:
getSslContext in interface SslContextFactory
Returns:
a ssl context object


Copyright © 2011. All Rights Reserved.