Package org.red5.client.net.rtmp
Class OutboundHandshake
- java.lang.Object
-
- org.red5.server.net.rtmp.RTMPHandshake
-
- org.red5.client.net.rtmp.OutboundHandshake
-
- All Implemented Interfaces:
org.red5.server.net.IHandshake
public class OutboundHandshake extends org.red5.server.net.rtmp.RTMPHandshakePerforms handshaking for client connections.- Author:
- Paul Gregoire
-
-
Field Summary
-
Fields inherited from class org.red5.server.net.rtmp.RTMPHandshake
algorithm, BLOWFISH_KEYS, buffer, cipherIn, cipherOut, DH_BASE, DH_MODULUS, DH_MODULUS_BYTES, DIGEST_LENGTH, fp9Handshake, GENUINE_FMS_KEY, GENUINE_FP_KEY, HANDSHAKE_TYPES, handshakeBytes, handshakeType, incomingPublicKey, KEY_LENGTH, keyAgreement, log, outgoingPublicKey, random, swfSize, swfVerificationBytes, XTEA_KEYS
-
-
Constructor Summary
Constructors Constructor Description OutboundHandshake()OutboundHandshake(byte handshakeType)OutboundHandshake(byte handshakeType, int algorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateHandshakeBytes()Creates the servers handshake bytesorg.apache.mina.core.buffer.IoBufferdecodeServerResponse1(org.apache.mina.core.buffer.IoBuffer in)Decodes the first server response (S1) and returns a client response (C2).booleandecodeServerResponse2(org.apache.mina.core.buffer.IoBuffer in)Decodes the second server response (S2).org.apache.mina.core.buffer.IoBufferdoHandshake(org.apache.mina.core.buffer.IoBuffer input)org.apache.mina.core.buffer.IoBuffergenerateClientRequest1()Create the first part of the outgoing connection request (C0 and C1).byte[]getHandshakeBytes()voidinitSwfVerification(String swfFilePath)Initialize SWF verification data.voidsetForceVerification(boolean forceVerification)booleanvalidate(byte[] handshake)Determines the validation scheme for given input.-
Methods inherited from class org.red5.server.net.rtmp.RTMPHandshake
addBuffer, addBuffer, calculateDigest, calculateHMAC_SHA256, calculateSwfVerification, generateKeyPair, getBlowfishSignature, getBuffer, getBufferAsIoBuffer, getBufferSize, getCipherIn, getCipherOut, getDHOffset, getDHOffset1, getDHOffset2, getDigestOffset, getDigestOffset1, getDigestOffset2, getHandshakeType, getPublicKey, getSharedSecret, getSwfVerificationBytes, getXteaSignature, initRC4Encryption, setHandshakeType, useEncryption, validHandshakeType, verifyDigest
-
-
-
-
Method Detail
-
doHandshake
public org.apache.mina.core.buffer.IoBuffer doHandshake(org.apache.mina.core.buffer.IoBuffer input)
-
createHandshakeBytes
protected void createHandshakeBytes()
Creates the servers handshake bytes- Specified by:
createHandshakeBytesin classorg.red5.server.net.rtmp.RTMPHandshake
-
generateClientRequest1
public org.apache.mina.core.buffer.IoBuffer generateClientRequest1()
Create the first part of the outgoing connection request (C0 and C1).C0 = 0x03 (client handshake type - 0x03, 0x06, 0x08, or 0x09) C1 = 1536 bytes from the client
- Returns:
- outgoing handshake C0+C1
-
decodeServerResponse1
public org.apache.mina.core.buffer.IoBuffer decodeServerResponse1(org.apache.mina.core.buffer.IoBuffer in)
Decodes the first server response (S1) and returns a client response (C2).S1 = 1536 bytes from the server C2 = Copy of S1 bytes
- Parameters:
in- incoming handshake S1- Returns:
- client response C2
-
decodeServerResponse2
public boolean decodeServerResponse2(org.apache.mina.core.buffer.IoBuffer in)
Decodes the second server response (S2).S2 = Copy of C1 bytes
- Parameters:
in- incoming handshake S2- Returns:
- true if validation passes and false otherwise
-
validate
public boolean validate(byte[] handshake)
Determines the validation scheme for given input.- Specified by:
validatein interfaceorg.red5.server.net.IHandshake- Specified by:
validatein classorg.red5.server.net.rtmp.RTMPHandshake- Parameters:
handshake- the handshake bytes from the server- Returns:
- true if server used a supported validation scheme, false if unsupported
-
initSwfVerification
public void initSwfVerification(String swfFilePath)
Initialize SWF verification data.- Parameters:
swfFilePath- path to the swf file or null
-
getHandshakeBytes
public byte[] getHandshakeBytes()
-
setForceVerification
public void setForceVerification(boolean forceVerification)
-
-