Object

com.malliina.security

MultiKeyStoreManager

Related Doc: package security

Permalink

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
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

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

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

    Permalink

    Find a X509 key manager compatible with a particular algorithm

    Find a X509 key manager compatible with a particular algorithm

    Exceptions thrown
  11. def getX509TrustManager(algorithm: String, kmFact: TrustManagerFactory): X509TrustManager

    Permalink
  12. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  14. val log: Logger

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

    Permalink
    Definition Classes
    AnyRef
  16. def newJvmKeyManager: X509KeyManager

    Permalink
  17. def newJvmTrustManager: X509TrustManager

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

    Permalink

    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

    returns

    a key manager

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

    Permalink
  20. def newSslContext(keySettings: IKeystoreSettings): SSLContext

    Permalink

    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

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

    Permalink

    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

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

    Permalink
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

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

    Permalink

    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

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

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

    Permalink
  28. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Log

Inherited from AnyRef

Inherited from Any

Ungrouped