org.red5.server.net.rtmp
Class RTMPHandshake

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

public class RTMPHandshake
extends Object
implements IHandshake

Generates the second 1536 byte chunk in the RTMP handshake response for compatibility with Flash 9,0,124,0. Clients that require this send a nonzero value as the fifth byte of the handshake request.
This class is based on the Ruby handshaking code from Takuma Mori.

Author:
Jacinto Shy II (jacinto.m.shy@ieee.org), Steven Zimmer (stevenlzimmer@gmail.com), Paul Gregoire (mondain@gmail.com)

Field Summary
static byte[] HANDSHAKE_PAD_BYTES
           
protected static Logger log
           
protected  Random random
           
 
Constructor Summary
RTMPHandshake()
           
 
Method Summary
 byte[] calculateHMAC_SHA256(byte[] input, byte[] key)
           
 org.apache.mina.core.buffer.IoBuffer generateResponse(org.apache.mina.core.buffer.IoBuffer input)
           
static byte[] getHandshakeBytes()
           
protected  byte[] getNewKeyPart(org.apache.mina.core.buffer.IoBuffer input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log

HANDSHAKE_PAD_BYTES

public static final byte[] HANDSHAKE_PAD_BYTES

random

protected Random random
Constructor Detail

RTMPHandshake

public RTMPHandshake()
Method Detail

generateResponse

public org.apache.mina.core.buffer.IoBuffer generateResponse(org.apache.mina.core.buffer.IoBuffer input)
Specified by:
generateResponse in interface IHandshake

calculateHMAC_SHA256

public byte[] calculateHMAC_SHA256(byte[] input,
                                   byte[] key)

getHandshakeBytes

public static byte[] getHandshakeBytes()

getNewKeyPart

protected byte[] getNewKeyPart(org.apache.mina.core.buffer.IoBuffer input)


Copyright © 2006-2009 The Red5 Project