Package com.biglybt.core.security.impl
Class SESecurityManagerImpl
java.lang.Object
com.biglybt.core.security.impl.SESecurityManagerImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static boolean
private static boolean
protected final CopyOnWriteList
<SECertificateListener> protected boolean
private Constructor
private boolean
private boolean
protected String
protected static String
private static final LogIDs
protected final CopyOnWriteList
<SEPasswordListener> protected static final SESecurityManagerImpl
(package private) final List
protected final AEMonitor
private static final ThreadLocal
<Object> protected String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
addCertToKeyStore
(String alias, Key public_key, Certificate[] certChain) protected SSLSocketFactory
addCertToTrustStore
(String alias, Certificate cert, boolean update_https_factory) void
protected boolean
protected boolean
void
private SSLSocket
createInstallServerCertificatesSocket
(TrustManager[] trustAllCerts, String host, int port, boolean sni_hack, boolean use_proxy) createSelfSignedCertificate
(String alias, String cert_dn, int strength) protected boolean
ensureStoreExists
(String name) void
exitVM
(int status) boolean
filterNetworkInterfaces
(List<NetworkInterface> interfaces) getAllTrustingTrustManager
(X509TrustManager delegate) getAuthentication
(String realm, String protocol, String host, int port) Class<?>[]
getKeyDetails
(String alias) getPasswordAuthentication
(String realm, URL tracker) static SESecurityManagerImpl
private KeyStore
private KeyStore
getTrustStore
(boolean attempt_recovery) private void
void
void
protected void
installServerCertificates
(String alias, String host, int port) private SSLSocketFactory
installServerCertificates
(String alias, String host, int port, boolean sni_hack, boolean use_proxy) installServerCertificates
(URL https_url) private SSLSocketFactory
installServerCertificates
(URL https_url, boolean sni_hack, boolean dh_hack, boolean use_proxy) protected boolean
private KeyStore
private KeyStore
loadKeyStore
(KeyManagerFactory keyManagerFactory) static void
void
void
boolean
resetTrustStore
(boolean test_only) private boolean
resetTrustStore
(boolean test_only, boolean recovering) void
void
setPasswordAuthenticationOutcome
(String realm, URL tracker, boolean success) void
setPasswordHandler
(URL url, SEPasswordListener l) void
void
stopThread
(Thread t) void
-
Field Details
-
LOGID
-
singleton
-
KEYSTORE_TYPE
-
auto_install_certs
private static boolean auto_install_certs -
auto_decline_certs
private static boolean auto_decline_certs -
keystore_name
-
truststore_name
-
certificate_listeners
-
password_listeners
-
tls
-
password_handlers
-
certificate_handlers
-
exit_vm_permitted
protected boolean exit_vm_permitted -
my_sec_man
-
store_mon
-
initialized
private boolean initialized -
stoppable_threads
-
hack_constructor_tried
private boolean hack_constructor_tried -
hack_constructor
-
-
Constructor Details
-
SESecurityManagerImpl
public SESecurityManagerImpl()
-
-
Method Details
-
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
-
getKeystorePassword
-
installSecurityManager
protected void installSecurityManager() -
isStoppableThread
protected boolean isStoppableThread() -
stopThread
-
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
-
getTrustStore
- Throws:
Exception
-
getTrustStore
- Throws:
Exception
-
loadKeyStore
- Throws:
Exception
-
loadKeyStore
- Throws:
Exception
-
getSSLServerSocketFactory
- Throws:
Exception
-
getKeyDetails
- Throws:
Exception
-
createSelfSignedCertificate
public Certificate createSelfSignedCertificate(String alias, String cert_dn, int strength) throws Exception - Throws:
Exception
-
getTrustManagerFactory
-
getSSLSocketFactory
-
getAllTrustingTrustManager
-
getAllTrustingTrustManager
-
installServerCertificates
-
installServerCertificates
-
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
-
setPasswordAuthenticationOutcome
-
addPasswordListener
-
removePasswordListener
-
clearPasswords
public void clearPasswords() -
setThreadPasswordHandler
-
unsetThreadPasswordHandler
public void unsetThreadPasswordHandler() -
setPasswordHandler
-
addCertificateListener
-
setCertificateHandler
-
removeCertificateListener
-
getClassContext
-
filterNetworkInterfaces
-
main
-