org.red5.server.net.rtmp
Class OutboundHandshake

java.lang.Object
  extended by org.red5.server.net.rtmp.RTMPHandshake
      extended by org.red5.server.net.rtmp.OutboundHandshake
All Implemented Interfaces:
IHandshake

public class OutboundHandshake
extends RTMPHandshake

Performs handshaking for client connections.

Author:
Paul Gregoire

Field Summary
 
Fields inherited from class org.red5.server.net.rtmp.RTMPHandshake
cipherIn, cipherOut, DH_BASE, DH_MODULUS, DH_MODULUS_BYTES, DIGEST_LENGTH, GENUINE_FMS_KEY, GENUINE_FP_KEY, HANDSHAKE_PAD_BYTES, HANDSHAKE_SIZE_SERVER, handshakeBytes, handshakeType, incomingPublicKey, KEY_LENGTH, keyAgreement, log, outgoingPublicKey, random, validationScheme
 
Constructor Summary
OutboundHandshake()
           
 
Method Summary
protected  void createHandshakeBytes()
          Creates the servers handshake bytes
 boolean decodeServerResponse(IoBuffer in)
           
 IoBuffer doHandshake(IoBuffer input)
          Generates initial handshake request, validates response, and generates final handshake.
 IoBuffer generateClientRequest1()
          Create the first part of the outgoing (client) connection request.
 IoBuffer generateClientRequest2()
           
protected  byte[] getFourBytesFrom(IoBuffer buf, int offset)
           
 boolean validate(IoBuffer input)
          Determines the validation scheme for given input.
 
Methods inherited from class org.red5.server.net.rtmp.RTMPHandshake
calculateHMAC_SHA256, calculateHMAC_SHA256, generateKeyPair, getCipherIn, getCipherOut, getDHOffset, getDHOffset0, getDHOffset1, getDigestOffset, getDigestOffset0, getDigestOffset1, getHandshakeBytes, getHandshakeType, getPublicKey, getSharedSecret, setHandshakeType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutboundHandshake

public OutboundHandshake()
Method Detail

doHandshake

public IoBuffer doHandshake(IoBuffer input)
Generates initial handshake request, validates response, and generates final handshake.

Parameters:
input - incoming RTMP bytes
Returns:
outgoing handshake

createHandshakeBytes

protected void createHandshakeBytes()
Creates the servers handshake bytes


generateClientRequest1

public IoBuffer generateClientRequest1()
Create the first part of the outgoing (client) connection request.

Returns:
outgoing handshake

decodeServerResponse

public boolean decodeServerResponse(IoBuffer in)

generateClientRequest2

public IoBuffer generateClientRequest2()

getFourBytesFrom

protected byte[] getFourBytesFrom(IoBuffer buf,
                                  int offset)

validate

public boolean validate(IoBuffer input)
Determines the validation scheme for given input.

Specified by:
validate in interface IHandshake
Specified by:
validate in class RTMPHandshake
Parameters:
input -
Returns:
true if client used a supported validation scheme, false if unsupported


Copyright © 2006-2010 The Red5 Project