org.gudy.azureus2.plugins.download.session
Interface SessionAuthenticator


public interface SessionAuthenticator

A session authenticator handles secure torrent session handshaking and data encryption/decryption on behalf of a download.


Method Summary
 java.util.Map createSessionSyn(Peer peer)
          Create bencode-able map info for outgoing session syn.
 PooledByteBuffer decodeSessionData(Peer peer, PooledByteBuffer encoded_data)
          Decode the given (possibly encrypted) session data into clean form.
 PooledByteBuffer encodeSessionData(Peer peer, PooledByteBuffer decoded_data)
          Encode the given clean session data into (possibly encrypted) encoded form.
 void verifySessionAck(Peer peer, java.util.Map ack_info)
          Decode and verify the given (bencoded) map of outgoing session ACK information.
 java.util.Map verifySessionSyn(Peer peer, java.util.Map syn_info)
          Decode and verify the given (bencoded) map of incoming session SYN information, and create the session ACK reply.
 

Method Detail

createSessionSyn

java.util.Map createSessionSyn(Peer peer)
Create bencode-able map info for outgoing session syn.

Parameters:
peer - with session
Returns:
syn info

verifySessionSyn

java.util.Map verifySessionSyn(Peer peer,
                               java.util.Map syn_info)
                               throws SessionAuthenticatorException
Decode and verify the given (bencoded) map of incoming session SYN information, and create the session ACK reply.

Parameters:
peer - with session
syn_info - incoming session syn info
Returns:
bencode-able map info for session ack reply
Throws:
SessionAuthenticatorException - on verify error / failure

verifySessionAck

void verifySessionAck(Peer peer,
                      java.util.Map ack_info)
                      throws SessionAuthenticatorException
Decode and verify the given (bencoded) map of outgoing session ACK information.

Parameters:
peer - with session
ack_info - incoming session ack info
Throws:
SessionAuthenticatorException - on verify error / failure

decodeSessionData

PooledByteBuffer decodeSessionData(Peer peer,
                                   PooledByteBuffer encoded_data)
                                   throws SessionAuthenticatorException
Decode the given (possibly encrypted) session data into clean form.

Parameters:
peer - with session
encoded_data - to decode
Returns:
decoded form of data
Throws:
SessionAuthenticatorException - on decode error / failure

encodeSessionData

PooledByteBuffer encodeSessionData(Peer peer,
                                   PooledByteBuffer decoded_data)
                                   throws SessionAuthenticatorException
Encode the given clean session data into (possibly encrypted) encoded form.

Parameters:
peer - with session
decoded_data - to encode
Returns:
encoded form of data
Throws:
SessionAuthenticatorException - on encode error / failure