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:
IHandshake
Performs handshaking for client connections.
- Author:
- Paul Gregoire
-
Field Summary
Fields inherited from class org.red5.server.net.rtmp.RTMPHandshake
algorithm, blowfish, BLOWFISH_KEYS, 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, XTEA_KEYS -
Constructor Summary
ConstructorsConstructorDescriptionOutboundHandshake(byte handshakeType) OutboundHandshake(byte handshakeType, int algorithm) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCreates 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(byte[] s2) Decodes the second server response (S2).booleandecodeServerResponse2(org.apache.mina.core.buffer.IoBuffer buf) Decodes the second server response (S2).org.apache.mina.core.buffer.IoBufferdoHandshake(org.apache.mina.core.buffer.IoBuffer input) org.apache.mina.core.buffer.IoBufferCreate the first part of the outgoing connection request (C0 and C1).byte[]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
calculateDigest, calculateHMAC_SHA256, calculateSwfVerification, generateKeyPair, getBlowfishSignature, getCipherIn, getCipherOut, getDHOffset, getDHOffset1, getDHOffset2, getDigestOffset, getDigestOffset1, getDigestOffset2, getHandshakeType, getPublicKey, getSharedSecret, getSwfVerificationBytes, getXteaSignature, initBlowfishEncryption, initRC4Encryption, initXteaEncryption, setHandshakeType, useEncryption, validHandshakeType, verifyDigest
-
Constructor Details
-
OutboundHandshake
public OutboundHandshake() -
OutboundHandshake
public OutboundHandshake(byte handshakeType) -
OutboundHandshake
public OutboundHandshake(byte handshakeType, int algorithm)
-
-
Method Details
-
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 classRTMPHandshake
-
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 buf) Decodes the second server response (S2).S2 = Copy of C1 bytes
- Parameters:
in- incoming handshake S2- Returns:
- true if validation passes and false otherwise
-
decodeServerResponse2
public boolean decodeServerResponse2(byte[] s2) 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 interfaceIHandshake- Specified by:
validatein classRTMPHandshake- Parameters:
handshake- the handshake bytes from the server- Returns:
- true if server used a supported validation scheme, false if unsupported
-
initSwfVerification
Initialize SWF verification data.- Parameters:
swfFilePath- path to the swf file or null
-
getHandshakeBytes
public byte[] getHandshakeBytes() -
setForceVerification
public void setForceVerification(boolean forceVerification)
-