|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.net.rtmp.RTMPHandshake
public class RTMPHandshake
Generates and validates the RTMP handshake response for Flash Players. Client versions equal to or greater than Flash 9,0,124,0 require a nonzero value as the fifth byte of the handshake request.
| Field Summary | |
|---|---|
protected static BigInteger |
DH_BASE
|
protected static BigInteger |
DH_MODULUS
|
protected static byte[] |
DH_MODULUS_BYTES
Modulus bytes from flazr |
protected static byte[] |
GENUINE_FMS_KEY
|
protected static byte[] |
GENUINE_FP_KEY
|
static byte[] |
HANDSHAKE_PAD_BYTES
|
protected byte[] |
handshakeBytes
|
protected KeyAgreement |
keyAgreement
|
protected static org.slf4j.Logger |
log
|
protected static Random |
random
|
protected int |
validationScheme
|
| Constructor Summary | |
|---|---|
RTMPHandshake()
|
|
| Method Summary | |
|---|---|
byte[] |
calculateHMAC_SHA256(byte[] input,
byte[] key)
Calculates an HMAC SHA256 hash using a default key length. |
byte[] |
calculateHMAC_SHA256(byte[] input,
byte[] key,
int length)
Calculates an HMAC SHA256 hash using a set key length. |
protected KeyPair |
generateKeyPair()
Creates a Diffie-Hellman key pair. |
IoBuffer |
generateResponse(IoBuffer input)
Generates response for versioned connections. |
protected int |
getDHOffset0()
Returns the DH byte offset. |
protected int |
getDHOffset1()
Returns the DH byte offset. |
protected int |
getDigestOffset(byte[] pBuffer)
Returns the digest offset using current validation scheme. |
protected int |
getDigestOffset0(byte[] pBuffer)
Returns a digest byte offset. |
protected int |
getDigestOffset1(byte[] pBuffer)
Returns a digest byte offset. |
byte[] |
getHandshakeBytes()
Returns the contained handshake bytes. |
protected static byte[] |
getPublicKey(KeyPair keyPair)
Returns the public key for a given key pair. |
protected void |
prepareResponse()
Gets the DH offset in the handshake bytes array based on validation scheme Generates DH keypair Adds public key to handshake bytes |
protected boolean |
validateClient(IoBuffer input)
Determines the validation scheme for given input. |
protected boolean |
validateClientScheme(byte[] pBuffer,
int scheme)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.slf4j.Logger log
public static byte[] HANDSHAKE_PAD_BYTES
protected static final byte[] GENUINE_FMS_KEY
protected static final byte[] GENUINE_FP_KEY
protected static final byte[] DH_MODULUS_BYTES
protected static final BigInteger DH_MODULUS
protected static final BigInteger DH_BASE
protected static final Random random
protected KeyAgreement keyAgreement
protected byte[] handshakeBytes
protected int validationScheme
| Constructor Detail |
|---|
public RTMPHandshake()
| Method Detail |
|---|
public IoBuffer generateResponse(IoBuffer input)
generateResponse in interface IHandshakeinput - incoming RTMP bytes
public byte[] calculateHMAC_SHA256(byte[] input,
byte[] key)
input - key -
public byte[] calculateHMAC_SHA256(byte[] input,
byte[] key,
int length)
input - key - length -
protected KeyPair generateKeyPair()
protected static byte[] getPublicKey(KeyPair keyPair)
keyPair -
protected boolean validateClient(IoBuffer input)
input -
protected boolean validateClientScheme(byte[] pBuffer,
int scheme)
protected int getDHOffset0()
protected int getDHOffset1()
protected int getDigestOffset(byte[] pBuffer)
pBuffer -
protected int getDigestOffset0(byte[] pBuffer)
pBuffer - source for digest data
protected int getDigestOffset1(byte[] pBuffer)
pBuffer - source for digest data
protected void prepareResponse()
public byte[] getHandshakeBytes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||