com.mle.security

MultiKeyStoreManager

object MultiKeyStoreManager extends Log

Manages multiple different keystores/truststores for one JVM instance.

Removes the reliance on system properties to get SSL to work.

Usage: MultiKeyStoreManager.registerKeyStores(IKeystoreSettings) instead of:

sys.props("javax.net.ssl.keyStore") = keystorePath etc This class is not thread-safe. Note: Modules registering key/truststores using this object will trust all other truststores, in particular also truststores registered by other modules. Therefore, registering keystores like this is not recommended in multi-module applications unless no other option exists, since module A may inadvertedly trust a truststore registered by module B, which is hardly ever desired. A "module" is in this context something that uses truststores/keystores.

See also

http://stackoverflow.com/questions/1793979/registering-multiple-keystores-in-jvm for some early inspiration

Linear Supertypes
Log, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. MultiKeyStoreManager
  2. Log
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  12. def getX509KeyManager(algorithm: String, kmFact: KeyManagerFactory): X509KeyManager

    Find a X509 key manager compatible with a particular algorithm

    Find a X509 key manager compatible with a particular algorithm

    algorithm
    kmFact
    returns
    Exceptions thrown
    NoSuchAlgorithmException

  13. def getX509TrustManager(algorithm: String, kmFact: TrustManagerFactory): X509TrustManager

  14. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. val log: Logger

    Attributes
    protected
    Definition Classes
    Log
  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def newJvmKeyManager: X509KeyManager

  19. def newJvmTrustManager: X509TrustManager

  20. def newKeyManager(keyStore: Option[KeyStore], keyStorePass: Option[String]): X509KeyManager

    Build a key manager from a keystore.

    Build a key manager from a keystore.

    Pass None as arguments in order to get the default JVM key manager.

    keyStore

    the keystore with which to initialize the keystore manager

    keyStorePass
    returns

    a key manager

  21. def newKeyManager(keyStorePath: String, keyStorePass: String): X509KeyManager

  22. def newSslContext(keySettings: IKeystoreSettings): SSLContext

    Constructs an SSL context with the given key settings.

    Constructs an SSL context with the given key settings.

    The context will be initialized with a key/trust manager built from the given key settings in addition to the default JVM key/trust manager.

    keySettings

    key settings to initialize context with

    returns

    a new SSL context

  23. def newTrustManager(keyStore: Option[KeyStore]): X509TrustManager

    Pass None parameter to get the default JVM trust manager.

    Pass None parameter to get the default JVM trust manager.

    keyStore

    the truststore with which to initialize the trust manager

    returns

  24. def newTrustManager(trustStorePath: String, trustStorePass: String): X509TrustManager

  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def registerKeyStores(keySettings: IKeystoreSettings): Unit

    Adds the given key settings to the SSL context.

    Adds the given key settings to the SSL context.

    Applications that wish to set SSL properties like javax.net.ssl.* can - instead of polluting system properties - register the key settings using this method.

    keySettings

    keystore/truststore info to add to the JVM

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toJksKeyStore(storePath: String, storePass: String): KeyStore

  30. def toString(): String

    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Log

Inherited from AnyRef

Inherited from Any

Ungrouped