Class SESecurityManagerImpl
java.lang.Object
com.biglybt.pifimpl.local.utils.security.SESecurityManagerImpl
- All Implemented Interfaces:
SESecurityManager
-
Field Summary
FieldsFields inherited from interface com.biglybt.pif.utils.security.SESecurityManager
BLOCK_ENCRYPTION_AES, BLOCK_ENCRYPTION_NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCertificateListener
(CertificateListener listener) void
addPasswordListener
(PasswordListener listener) byte[]
calculateSHA1
(byte[] data_in) returns the SHA1 hash of the input datacreateSelfSignedCertificate
(String alias, String cert_dn, int strength) creates and installs a certificate capable of supporting SSL of type MD5withRSAbyte[]
Gets this the client instance's unique random identitygetPublicKey
(int key_type, int instance, String reason_resource) getPublicKey
(int key_type, String reason_resource) Gets the public key for this az instance of the supplied key typegetSTSConnection
(GenericMessageConnection connection, SEPublicKey my_public_key, SEPublicKeyLocator key_locator, String reason_resource, int block_crypto) Returns a proxy generic STS connection for incoming connection requestsInstalls the SSL certificate necessary to support the connectionvoid
removeCertificateListener
(CertificateListener listener) void
removePasswordListener
(PasswordListener listener) void
runWithAuthenticator
(Authenticator authenticator, Runnable target)
-
Field Details
-
core
-
password_listeners
-
certificate_listeners
-
-
Constructor Details
-
SESecurityManagerImpl
-
-
Method Details
-
calculateSHA1
public byte[] calculateSHA1(byte[] data_in) Description copied from interface:SESecurityManager
returns the SHA1 hash of the input data- Specified by:
calculateSHA1
in interfaceSESecurityManager
- Returns:
-
runWithAuthenticator
- Specified by:
runWithAuthenticator
in interfaceSESecurityManager
-
addPasswordListener
- Specified by:
addPasswordListener
in interfaceSESecurityManager
-
removePasswordListener
- Specified by:
removePasswordListener
in interfaceSESecurityManager
-
addCertificateListener
- Specified by:
addCertificateListener
in interfaceSESecurityManager
-
removeCertificateListener
- Specified by:
removeCertificateListener
in interfaceSESecurityManager
-
installServerCertificate
Description copied from interface:SESecurityManager
Installs the SSL certificate necessary to support the connection- Specified by:
installServerCertificate
in interfaceSESecurityManager
-
getKeyStore
- Specified by:
getKeyStore
in interfaceSESecurityManager
- Throws:
Exception
-
getTrustStore
- Specified by:
getTrustStore
in interfaceSESecurityManager
- Throws:
Exception
-
createSelfSignedCertificate
public Certificate createSelfSignedCertificate(String alias, String cert_dn, int strength) throws Exception Description copied from interface:SESecurityManager
creates and installs a certificate capable of supporting SSL of type MD5withRSA- Specified by:
createSelfSignedCertificate
in interfaceSESecurityManager
- Parameters:
alias
- alias - e.g. "mycert"cert_dn
- dn for the cert e.g. "CN=fred,OU=wap,O=wip,L=here,ST=there,C=GB"strength
- keyt strength - e.g. 1024- Returns:
- Throws:
Exception
-
getIdentity
public byte[] getIdentity()Description copied from interface:SESecurityManager
Gets this the client instance's unique random identity- Specified by:
getIdentity
in interfaceSESecurityManager
- Returns:
-
getPublicKey
Description copied from interface:SESecurityManager
Gets the public key for this az instance of the supplied key type- Specified by:
getPublicKey
in interfaceSESecurityManager
- Parameters:
key_type
- see KEY_TYPE_x constants in SEPublicKeyreason_resource
- a message text resource giving the reason for the key being required- Returns:
- Throws:
Exception
-
getPublicKey
public SEPublicKey getPublicKey(int key_type, int instance, String reason_resource) throws Exception - Specified by:
getPublicKey
in interfaceSESecurityManager
- Throws:
Exception
-
getSTSConnection
public GenericMessageConnection getSTSConnection(GenericMessageConnection connection, SEPublicKey my_public_key, SEPublicKeyLocator key_locator, String reason_resource, int block_crypto) throws Exception Description copied from interface:SESecurityManager
Returns a proxy generic STS connection for incoming connection requests- Specified by:
getSTSConnection
in interfaceSESecurityManager
- Returns:
- Throws:
Exception
-