All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mle.rmi.RmiUtil.scala Maven / Gradle / Ivy

The newest version!
package com.mle.rmi

import com.mle.security.{KeystoreSettings, MultiKeyStoreManager}
import com.mle.util.Util

/**
 * The security policy and/or the [[java.lang.SecurityManager]]
 * must be installed BEFORE logback is used.
 *
 * @author Mle
 */
object RmiUtil {
  val keystore = "security/develkeys/keystore.key"
  val keySettings = KeystoreSettings(keystore, "changeme", keystore, "changeme")

  def initClientSecurity() {
    initSecurityPolicy()
    MultiKeyStoreManager.registerKeyStores(keySettings)
  }

  def initSecurityPolicy() {
    sys.props("java.security.policy") = Util.resource("security/server.policy").toURI.toString
    //    if (System.getSecurityManager == null) {
    //      System.setSecurityManager(new SecurityManager)
    //    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy