Class SESecurityManagerImpl

java.lang.Object
com.biglybt.core.security.impl.SESecurityManagerImpl

public class SESecurityManagerImpl extends Object
  • Field Details

    • LOGID

      private static final LogIDs LOGID
    • singleton

      protected static final SESecurityManagerImpl singleton
    • KEYSTORE_TYPE

      protected static String KEYSTORE_TYPE
    • auto_install_certs

      private static boolean auto_install_certs
    • auto_decline_certs

      private static boolean auto_decline_certs
    • keystore_name

      protected String keystore_name
    • truststore_name

      protected String truststore_name
    • certificate_listeners

      protected final CopyOnWriteList<SECertificateListener> certificate_listeners
    • password_listeners

      protected final CopyOnWriteList<SEPasswordListener> password_listeners
    • tls

      private static final ThreadLocal<Object> tls
    • password_handlers

      protected final Map<String,Object[]> password_handlers
    • certificate_handlers

      protected final Map<String,Object[]> certificate_handlers
    • exit_vm_permitted

      protected boolean exit_vm_permitted
    • my_sec_man

      private volatile SESecurityManager.MySecurityManager my_sec_man
    • store_mon

      protected final AEMonitor store_mon
    • initialized

      private boolean initialized
    • stoppable_threads

      final List stoppable_threads
    • hack_constructor_tried

      private boolean hack_constructor_tried
    • hack_constructor

      private Constructor hack_constructor
  • Constructor Details

    • SESecurityManagerImpl

      public SESecurityManagerImpl()
  • Method Details

    • getSingleton

      public static SESecurityManagerImpl getSingleton()
    • initialise

      public void initialise()
    • initEmptyTrustStore

      private void initEmptyTrustStore()
    • resetTrustStore

      public boolean resetTrustStore(boolean test_only)
    • resetTrustStore

      private boolean resetTrustStore(boolean test_only, boolean recovering)
    • getKeystoreName

      public String getKeystoreName()
    • getKeystorePassword

      public String getKeystorePassword()
    • installSecurityManager

      protected void installSecurityManager()
    • isStoppableThread

      protected boolean isStoppableThread()
    • stopThread

      public void stopThread(Thread t)
    • canExitVM

      protected boolean canExitVM()
    • exitVM

      public void exitVM(int status)
    • installAuthenticator

      public void installAuthenticator()
    • getAuthentication

      public PasswordAuthentication getAuthentication(String realm, String protocol, String host, int port)
    • checkKeyStoreHasEntry

      protected boolean checkKeyStoreHasEntry()
    • ensureStoreExists

      protected boolean ensureStoreExists(String name)
    • getTrustStore

      private KeyStore getTrustStore() throws Exception
      Throws:
      Exception
    • getTrustStore

      private KeyStore getTrustStore(boolean attempt_recovery) throws Exception
      Throws:
      Exception
    • loadKeyStore

      private KeyStore loadKeyStore() throws Exception
      Throws:
      Exception
    • loadKeyStore

      private KeyStore loadKeyStore(KeyManagerFactory keyManagerFactory) throws Exception
      Throws:
      Exception
    • getSSLServerSocketFactory

      public SSLServerSocketFactory getSSLServerSocketFactory() throws Exception
      Throws:
      Exception
    • getKeyDetails

      public SEKeyDetails getKeyDetails(String alias) throws Exception
      Throws:
      Exception
    • createSelfSignedCertificate

      public Certificate createSelfSignedCertificate(String alias, String cert_dn, int strength) throws Exception
      Throws:
      Exception
    • getTrustManagerFactory

      public TrustManagerFactory getTrustManagerFactory()
    • getSSLSocketFactory

      public SSLSocketFactory getSSLSocketFactory()
    • getAllTrustingTrustManager

      public TrustManager[] getAllTrustingTrustManager()
    • getAllTrustingTrustManager

      public TrustManager[] getAllTrustingTrustManager(X509TrustManager delegate)
    • installServerCertificates

      public SSLSocketFactory installServerCertificates(URL https_url)
    • installServerCertificates

      public SSLSocketFactory installServerCertificates(String alias, String host, int port)
    • createInstallServerCertificatesSocket

      private SSLSocket createInstallServerCertificatesSocket(TrustManager[] trustAllCerts, String host, int port, boolean sni_hack, boolean use_proxy) throws Throwable
      Throws:
      Throwable
    • installServerCertificates

      private SSLSocketFactory installServerCertificates(URL https_url, boolean sni_hack, boolean dh_hack, boolean use_proxy) throws Throwable
      Throws:
      Throwable
    • installServerCertificates

      private SSLSocketFactory installServerCertificates(String alias, String host, int port, boolean sni_hack, boolean use_proxy) throws Throwable
      Throws:
      Throwable
    • addCertToKeyStore

      protected void addCertToKeyStore(String alias, Key public_key, Certificate[] certChain) throws Exception
      Throws:
      Exception
    • addCertToTrustStore

      protected SSLSocketFactory addCertToTrustStore(String alias, Certificate cert, boolean update_https_factory) throws Exception
      Throws:
      Exception
    • getPasswordAuthentication

      public PasswordAuthentication getPasswordAuthentication(String realm, URL tracker)
    • setPasswordAuthenticationOutcome

      public void setPasswordAuthenticationOutcome(String realm, URL tracker, boolean success)
    • addPasswordListener

      public void addPasswordListener(SEPasswordListener l)
    • removePasswordListener

      public void removePasswordListener(SEPasswordListener l)
    • clearPasswords

      public void clearPasswords()
    • setThreadPasswordHandler

      public void setThreadPasswordHandler(SEPasswordListener l)
    • unsetThreadPasswordHandler

      public void unsetThreadPasswordHandler()
    • setPasswordHandler

      public void setPasswordHandler(URL url, SEPasswordListener l)
    • addCertificateListener

      public void addCertificateListener(SECertificateListener l)
    • setCertificateHandler

      public void setCertificateHandler(URL url, SECertificateListener l)
    • removeCertificateListener

      public void removeCertificateListener(SECertificateListener l)
    • getClassContext

      public Class<?>[] getClassContext()
    • filterNetworkInterfaces

      public boolean filterNetworkInterfaces(List<NetworkInterface> interfaces)
    • main

      public static void main(String[] args)