Methods Summary |
---|
public void | addCertificateListener(org.gudy.azureus2.plugins.utils.security.CertificateListener listener)
SECertificateListener sepl =
new SECertificateListener()
{
public boolean
trustCertificate(
String resource,
X509Certificate cert )
{
return( listener.trustCertificate( resource, cert ));
}
};
certificate_listeners.put( listener, sepl );
SESecurityManager.addCertificateListener( sepl );
|
public void | addPasswordListener(org.gudy.azureus2.plugins.utils.security.PasswordListener listener)
SEPasswordListener sepl =
new SEPasswordListener()
{
public PasswordAuthentication
getAuthentication(
String realm,
URL tracker )
{
return( listener.getAuthentication( realm, tracker ));
}
public void
setAuthenticationOutcome(
String realm,
URL tracker,
boolean success )
{
listener.setAuthenticationOutcome( realm, tracker, success );
}
public void
clearPasswords()
{
}
};
password_listeners.put( listener, sepl );
SESecurityManager.addPasswordListener( sepl );
|
public byte[] | calculateSHA1(byte[] data_in)
if (data_in == null ){
data_in = new byte[0];
}
SHA1Hasher hasher = new SHA1Hasher();
return( hasher.calculateHash(data_in));
|
public java.security.cert.Certificate | createSelfSignedCertificate(java.lang.String alias, java.lang.String cert_dn, int strength)
return( SESecurityManager.createSelfSignedCertificate(alias, cert_dn, strength ));
|
public org.gudy.azureus2.plugins.utils.security.SEPublicKey | decodePublicKey(byte[] encoded)
return( SEPublicKeyImpl.decode( encoded ));
|
public byte[] | getIdentity()
return( core.getCryptoManager().getSecureID());
|
public java.security.KeyStore | getKeyStore()
return( SESecurityManager.getKeyStore());
|
public org.gudy.azureus2.plugins.utils.security.SEPublicKey | getPublicKey(int key_type, java.lang.String reason_resource)
byte[] encoded = core.getCryptoManager().getECCHandler().getPublicKey( reason_resource );
return( new SEPublicKeyImpl( key_type, encoded ));
|
public org.gudy.azureus2.plugins.messaging.generic.GenericMessageConnection | getSTSConnection(org.gudy.azureus2.plugins.messaging.generic.GenericMessageConnection connection, org.gudy.azureus2.plugins.utils.security.SEPublicKey my_public_key, org.gudy.azureus2.plugins.utils.security.SEPublicKeyLocator key_locator, java.lang.String reason_resource, int block_crypto)
return( new SESTSConnectionImpl( core, (GenericMessageConnectionImpl)connection, my_public_key, key_locator, reason_resource, block_crypto ));
|
public java.security.KeyStore | getTrustStore()
return( SESecurityManager.getTrustStore());
|
public javax.net.ssl.SSLSocketFactory | installServerCertificate(java.net.URL url)
return( SESecurityManager.installServerCertificates( url ));
|
public void | removeCertificateListener(org.gudy.azureus2.plugins.utils.security.CertificateListener listener)
SECertificateListener sepl = (SECertificateListener)certificate_listeners.get( listener );
if ( sepl != null ){
SESecurityManager.removeCertificateListener( sepl );
}
|
public void | removePasswordListener(org.gudy.azureus2.plugins.utils.security.PasswordListener listener)
SEPasswordListener sepl = (SEPasswordListener)password_listeners.get( listener );
if ( sepl != null ){
SESecurityManager.removePasswordListener( sepl );
}
|
public void | runWithAuthenticator(java.net.Authenticator authenticator, java.lang.Runnable target)
try{
Authenticator.setDefault( authenticator );
target.run();
}finally{
SESecurityManager.installAuthenticator();
}
|